From 2a8741cb87eb2b82381a6220a98f80f741147837 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 27 Jun 2022 19:34:24 +0000 Subject: [PATCH] [Java] Update auto-generated Java bindings for 0.0.108 --- .../java/org/ldk/enums/Secp256k1Error.java | 16 +- src/main/java/org/ldk/impl/bindings.java | 1730 +- src/main/java/org/ldk/structs/APIError.java | 2 +- .../java/org/ldk/structs/AcceptChannel.java | 4 +- src/main/java/org/ldk/structs/Access.java | 4 +- .../ldk/structs/AnnouncementSignatures.java | 4 +- .../org/ldk/structs/BackgroundProcessor.java | 41 +- src/main/java/org/ldk/structs/BaseSign.java | 18 +- src/main/java/org/ldk/structs/BestBlock.java | 6 +- src/main/java/org/ldk/structs/BigSize.java | 53 + .../structs/BuiltCommitmentTransaction.java | 4 +- .../java/org/ldk/structs/ChainMonitor.java | 4 +- .../java/org/ldk/structs/ChainParameters.java | 6 +- .../org/ldk/structs/ChannelAnnouncement.java | 6 +- .../java/org/ldk/structs/ChannelConfig.java | 6 +- .../org/ldk/structs/ChannelCounterparty.java | 60 +- .../java/org/ldk/structs/ChannelDetails.java | 182 +- .../java/org/ldk/structs/ChannelFeatures.java | 6 +- .../ldk/structs/ChannelHandshakeConfig.java | 89 +- .../ldk/structs/ChannelHandshakeLimits.java | 90 +- .../java/org/ldk/structs/ChannelInfo.java | 30 +- .../java/org/ldk/structs/ChannelManager.java | 126 +- .../ldk/structs/ChannelManagerReadArgs.java | 4 +- .../ldk/structs/ChannelMessageHandler.java | 58 +- .../java/org/ldk/structs/ChannelMonitor.java | 4 +- .../org/ldk/structs/ChannelMonitorUpdate.java | 2 +- .../org/ldk/structs/ChannelPublicKeys.java | 4 +- .../{FundingLocked.java => ChannelReady.java} | 50 +- .../org/ldk/structs/ChannelReestablish.java | 2 +- .../structs/ChannelTransactionParameters.java | 14 +- .../org/ldk/structs/ChannelTypeFeatures.java | 108 +- .../java/org/ldk/structs/ChannelUpdate.java | 6 +- .../org/ldk/structs/ChannelUpdateInfo.java | 8 +- .../java/org/ldk/structs/ChannelUsage.java | 114 + .../java/org/ldk/structs/ClosingSigned.java | 6 +- .../ldk/structs/ClosingSignedFeeRange.java | 4 +- .../org/ldk/structs/ClosingTransaction.java | 6 +- .../java/org/ldk/structs/ClosureReason.java | 10 +- .../org/ldk/structs/CommitmentSigned.java | 4 +- .../ldk/structs/CommitmentTransaction.java | 4 +- .../org/ldk/structs/CommitmentUpdate.java | 16 +- ...nterpartyChannelTransactionParameters.java | 6 +- .../CounterpartyCommitmentSecrets.java | 6 +- .../structs/CounterpartyForwardingInfo.java | 4 +- .../java/org/ldk/structs/DataLossProtect.java | 4 +- .../java/org/ldk/structs/DecodeError.java | 2 +- .../java/org/ldk/structs/DefaultRouter.java | 2 +- .../DelayedPaymentOutputDescriptor.java | 6 +- .../java/org/ldk/structs/Description.java | 2 +- .../org/ldk/structs/DirectedChannelInfo.java | 17 +- .../DirectedChannelTransactionParameters.java | 6 +- .../java/org/ldk/structs/ErrorAction.java | 6 +- .../java/org/ldk/structs/ErrorMessage.java | 4 +- .../ldk/structs/ErroringMessageHandler.java | 2 +- src/main/java/org/ldk/structs/Event.java | 364 +- .../java/org/ldk/structs/ExpandedKey.java | 40 + src/main/java/org/ldk/structs/ExpiryTime.java | 6 +- .../org/ldk/structs/FilesystemPersister.java | 15 +- src/main/java/org/ldk/structs/Filter.java | 2 +- .../org/ldk/structs/FixedPenaltyScorer.java | 4 +- .../java/org/ldk/structs/FundingCreated.java | 4 +- .../java/org/ldk/structs/FundingSigned.java | 4 +- src/main/java/org/ldk/structs/GossipSync.java | 107 + .../ldk/structs/GossipTimestampFilter.java | 4 +- .../java/org/ldk/structs/GraphSyncError.java | 103 + .../ldk/structs/HTLCOutputInCommitment.java | 4 +- src/main/java/org/ldk/structs/HTLCUpdate.java | 2 +- .../structs/HolderCommitmentTransaction.java | 4 +- .../ldk/structs/IgnoringMessageHandler.java | 2 +- .../java/org/ldk/structs/InMemorySigner.java | 10 +- src/main/java/org/ldk/structs/Init.java | 6 +- .../java/org/ldk/structs/InitFeatures.java | 439 +- .../ldk/structs/InvalidShutdownScript.java | 8 +- src/main/java/org/ldk/structs/Invoice.java | 10 +- .../java/org/ldk/structs/InvoiceFeatures.java | 108 +- .../java/org/ldk/structs/InvoicePayer.java | 10 +- .../org/ldk/structs/InvoiceSignature.java | 2 +- .../java/org/ldk/structs/KeysInterface.java | 2 +- .../java/org/ldk/structs/KeysManager.java | 4 +- .../java/org/ldk/structs/LightningError.java | 4 +- src/main/java/org/ldk/structs/Listen.java | 33 + src/main/java/org/ldk/structs/Logger.java | 2 +- .../java/org/ldk/structs/MessageHandler.java | 12 +- .../org/ldk/structs/MessageSendEvent.java | 60 +- .../org/ldk/structs/MinFinalCltvExpiry.java | 4 +- .../java/org/ldk/structs/MonitorEvent.java | 8 +- .../java/org/ldk/structs/MonitorUpdateId.java | 2 +- .../structs/MultiThreadedLockableScore.java | 11 +- .../java/org/ldk/structs/NetworkGraph.java | 91 +- .../java/org/ldk/structs/NetworkUpdate.java | 26 +- .../org/ldk/structs/NodeAnnouncement.java | 6 +- .../org/ldk/structs/NodeAnnouncementInfo.java | 8 +- .../java/org/ldk/structs/NodeFeatures.java | 448 +- src/main/java/org/ldk/structs/NodeId.java | 4 +- src/main/java/org/ldk/structs/NodeInfo.java | 8 +- .../java/org/ldk/structs/OpenChannel.java | 4 +- .../ldk/structs/Option_NetworkUpdateZ.java | 6 +- src/main/java/org/ldk/structs/OutPoint.java | 4 +- ...raphMsgHandler.java => P2PGossipSync.java} | 31 +- .../java/org/ldk/structs/PayeePubKey.java | 4 +- src/main/java/org/ldk/structs/Payer.java | 8 +- .../java/org/ldk/structs/PaymentError.java | 2 +- .../org/ldk/structs/PaymentParameters.java | 12 +- .../java/org/ldk/structs/PaymentPurpose.java | 20 + .../org/ldk/structs/PaymentSendFailure.java | 2 +- .../java/org/ldk/structs/PeerHandleError.java | 22 +- .../java/org/ldk/structs/PeerManager.java | 6 +- src/main/java/org/ldk/structs/Persist.java | 14 +- src/main/java/org/ldk/structs/Persister.java | 36 +- .../org/ldk/structs/PhantomKeysManager.java | 4 +- .../org/ldk/structs/PhantomRouteHints.java | 6 +- src/main/java/org/ldk/structs/Ping.java | 4 +- src/main/java/org/ldk/structs/Pong.java | 4 +- .../org/ldk/structs/PositiveTimestamp.java | 2 +- .../java/org/ldk/structs/PrivateRoute.java | 4 +- .../org/ldk/structs/ProbabilisticScorer.java | 25 +- .../ProbabilisticScoringParameters.java | 6 +- .../org/ldk/structs/QueryChannelRange.java | 4 +- .../org/ldk/structs/QueryShortChannelIds.java | 4 +- .../java/org/ldk/structs/RapidGossipSync.java | 82 + .../java/org/ldk/structs/RawDataPart.java | 4 +- src/main/java/org/ldk/structs/RawInvoice.java | 20 +- .../org/ldk/structs/ReadOnlyNetworkGraph.java | 6 +- src/main/java/org/ldk/structs/Record.java | 2 +- .../org/ldk/structs/ReplyChannelRange.java | 4 +- .../ldk/structs/ReplyShortChannelIdsEnd.java | 4 +- .../Result_AcceptChannelDecodeErrorZ.java | 4 +- ...lt_AnnouncementSignaturesDecodeErrorZ.java | 4 +- ...uiltCommitmentTransactionDecodeErrorZ.java | 4 +- ..._BlockHashChannelManagerZDecodeErrorZ.java | 2 +- ..._BlockHashChannelMonitorZDecodeErrorZ.java | 2 +- ...lt_COption_ClosureReasonZDecodeErrorZ.java | 2 +- .../Result_COption_EventZDecodeErrorZ.java | 2 +- ...ult_COption_MonitorEventZDecodeErrorZ.java | 2 +- ...lt_COption_NetworkUpdateZDecodeErrorZ.java | 2 +- .../Result_COption_TypeZDecodeErrorZ.java | 2 +- .../Result_CVec_u8ZPeerHandleErrorZ.java | 2 +- ...esult_ChannelAnnouncementDecodeErrorZ.java | 4 +- .../Result_ChannelConfigDecodeErrorZ.java | 4 +- ...esult_ChannelCounterpartyDecodeErrorZ.java | 4 +- .../Result_ChannelDetailsDecodeErrorZ.java | 4 +- .../Result_ChannelFeaturesDecodeErrorZ.java | 22 +- .../Result_ChannelInfoDecodeErrorZ.java | 4 +- ...sult_ChannelMonitorUpdateDecodeErrorZ.java | 4 +- .../Result_ChannelPublicKeysDecodeErrorZ.java | 4 +- .../Result_ChannelReadyDecodeErrorZ.java | 94 + ...Result_ChannelReestablishDecodeErrorZ.java | 4 +- ...nnelTransactionParametersDecodeErrorZ.java | 4 +- ...esult_ChannelTypeFeaturesDecodeErrorZ.java | 22 +- .../Result_ChannelUpdateDecodeErrorZ.java | 4 +- .../Result_ChannelUpdateInfoDecodeErrorZ.java | 4 +- .../Result_ClosingSignedDecodeErrorZ.java | 4 +- ...ult_ClosingSignedFeeRangeDecodeErrorZ.java | 4 +- .../Result_CommitmentSignedDecodeErrorZ.java | 4 +- ...ult_CommitmentTransactionDecodeErrorZ.java | 4 +- ...nnelTransactionParametersDecodeErrorZ.java | 4 +- ...terpartyCommitmentSecretsDecodeErrorZ.java | 4 +- ...ounterpartyForwardingInfoDecodeErrorZ.java | 4 +- ...edPaymentOutputDescriptorDecodeErrorZ.java | 4 +- .../Result_DescriptionCreationErrorZ.java | 2 +- .../Result_ErrorMessageDecodeErrorZ.java | 4 +- ...Result_FixedPenaltyScorerDecodeErrorZ.java | 4 +- .../Result_FundingCreatedDecodeErrorZ.java | 4 +- .../Result_FundingLockedDecodeErrorZ.java | 94 - .../Result_FundingSignedDecodeErrorZ.java | 4 +- ...ult_GossipTimestampFilterDecodeErrorZ.java | 4 +- ...lt_HTLCOutputInCommitmentDecodeErrorZ.java | 4 +- .../Result_HTLCUpdateDecodeErrorZ.java | 4 +- ...lderCommitmentTransactionDecodeErrorZ.java | 4 +- .../Result_InMemorySignerDecodeErrorZ.java | 4 +- .../ldk/structs/Result_InitDecodeErrorZ.java | 4 +- .../Result_InitFeaturesDecodeErrorZ.java | 22 +- .../Result_InvoiceFeaturesDecodeErrorZ.java | 22 +- .../Result_InvoiceParseOrSemanticErrorZ.java | 2 +- .../structs/Result_InvoiceSemanticErrorZ.java | 2 +- .../Result_InvoiceSignOrCreationErrorZ.java | 2 +- .../Result_LockedChannelMonitorNoneZ.java | 2 +- .../Result_NetAddressDecodeErrorZ.java | 2 +- .../Result_NetworkGraphDecodeErrorZ.java | 31 +- .../Result_NodeAnnouncementDecodeErrorZ.java | 4 +- ...sult_NodeAnnouncementInfoDecodeErrorZ.java | 4 +- .../Result_NodeFeaturesDecodeErrorZ.java | 22 +- .../structs/Result_NodeIdDecodeErrorZ.java | 4 +- .../structs/Result_NodeInfoDecodeErrorZ.java | 4 +- .../structs/Result_NoneLightningErrorZ.java | 2 +- .../structs/Result_NonePeerHandleErrorZ.java | 2 +- .../Result_OpenChannelDecodeErrorZ.java | 4 +- .../structs/Result_OutPointDecodeErrorZ.java | 4 +- .../ldk/structs/Result_PayeePubKeyErrorZ.java | 2 +- .../Result_PaymentParametersDecodeErrorZ.java | 4 +- .../Result_PaymentPurposeDecodeErrorZ.java | 94 + .../Result_PhantomRouteHintsDecodeErrorZ.java | 4 +- .../ldk/structs/Result_PingDecodeErrorZ.java | 4 +- .../ldk/structs/Result_PongDecodeErrorZ.java | 4 +- ...esult_PositiveTimestampCreationErrorZ.java | 2 +- .../Result_PrivateRouteCreationErrorZ.java | 2 +- ...esult_ProbabilisticScorerDecodeErrorZ.java | 10 +- .../Result_QueryChannelRangeDecodeErrorZ.java | 4 +- ...sult_QueryShortChannelIdsDecodeErrorZ.java | 4 +- .../Result_ReplyChannelRangeDecodeErrorZ.java | 4 +- ...t_ReplyShortChannelIdsEndDecodeErrorZ.java | 4 +- .../Result_RevokeAndACKDecodeErrorZ.java | 4 +- .../ldk/structs/Result_RouteDecodeErrorZ.java | 4 +- .../structs/Result_RouteHintDecodeErrorZ.java | 4 +- .../Result_RouteHintHopDecodeErrorZ.java | 4 +- .../structs/Result_RouteHopDecodeErrorZ.java | 4 +- .../structs/Result_RouteLightningErrorZ.java | 4 +- .../Result_RouteParametersDecodeErrorZ.java | 4 +- .../Result_RoutingFeesDecodeErrorZ.java | 4 +- .../structs/Result_ScorerDecodeErrorZ.java | 77 - .../Result_ScoringParametersDecodeErrorZ.java | 94 - .../structs/Result_ShutdownDecodeErrorZ.java | 4 +- .../Result_ShutdownScriptDecodeErrorZ.java | 4 +- ..._ShutdownScriptInvalidShutdownScriptZ.java | 4 +- .../ldk/structs/Result_SignDecodeErrorZ.java | 2 +- .../Result_SignedRawInvoiceParseErrorZ.java | 2 +- ...SpendableOutputDescriptorDecodeErrorZ.java | 2 +- ...icPaymentOutputDescriptorDecodeErrorZ.java | 4 +- .../org/ldk/structs/Result_StringErrorZ.java | 18 + ...Result_TrustedClosingTransactionNoneZ.java | 2 +- ...ult_TrustedCommitmentTransactionNoneZ.java | 2 +- .../Result_TxCreationKeysDecodeErrorZ.java | 4 +- .../structs/Result_TxCreationKeysErrorZ.java | 2 +- ...signedChannelAnnouncementDecodeErrorZ.java | 4 +- ...ult_UnsignedChannelUpdateDecodeErrorZ.java | 4 +- ..._UnsignedNodeAnnouncementDecodeErrorZ.java | 4 +- .../Result_UpdateAddHTLCDecodeErrorZ.java | 4 +- .../Result_UpdateFailHTLCDecodeErrorZ.java | 4 +- ...t_UpdateFailMalformedHTLCDecodeErrorZ.java | 4 +- .../structs/Result_UpdateFeeDecodeErrorZ.java | 4 +- .../Result_UpdateFulfillHTLCDecodeErrorZ.java | 4 +- .../Result_WarningMessageDecodeErrorZ.java | 4 +- .../structs/Result_boolLightningErrorZ.java | 2 +- .../structs/Result_boolPeerHandleErrorZ.java | 2 +- .../structs/Result_u32GraphSyncErrorZ.java | 73 + src/main/java/org/ldk/structs/Retry.java | 126 + .../java/org/ldk/structs/RetryAttempts.java | 98 - .../java/org/ldk/structs/RevokeAndACK.java | 4 +- src/main/java/org/ldk/structs/Route.java | 26 +- src/main/java/org/ldk/structs/RouteHint.java | 6 +- .../java/org/ldk/structs/RouteHintHop.java | 6 +- src/main/java/org/ldk/structs/RouteHop.java | 8 +- .../java/org/ldk/structs/RouteParameters.java | 10 +- src/main/java/org/ldk/structs/Router.java | 4 +- .../java/org/ldk/structs/RoutingFees.java | 4 +- .../ldk/structs/RoutingMessageHandler.java | 18 +- src/main/java/org/ldk/structs/Score.java | 23 +- src/main/java/org/ldk/structs/Scorer.java | 91 - .../org/ldk/structs/ScoringParameters.java | 242 - src/main/java/org/ldk/structs/Sha256.java | 2 +- src/main/java/org/ldk/structs/Shutdown.java | 4 +- .../java/org/ldk/structs/ShutdownScript.java | 12 +- .../org/ldk/structs/SignedRawInvoice.java | 6 +- .../structs/SpendableOutputDescriptor.java | 6 +- .../StaticPaymentOutputDescriptor.java | 6 +- ...nouncementChannelUpdateChannelUpdateZ.java | 6 +- ...uple_RawInvoice_u832InvoiceSignatureZ.java | 4 +- .../structs/TrustedCommitmentTransaction.java | 6 +- .../TwoTuple_BlockHashChannelManagerZ.java | 2 +- .../TwoTuple_BlockHashChannelMonitorZ.java | 2 +- .../TwoTuple_OutPointCVec_MonitorEventZZ.java | 84 + .../ldk/structs/TwoTuple_OutPointScriptZ.java | 2 +- .../java/org/ldk/structs/TxCreationKeys.java | 4 +- .../structs/UnsignedChannelAnnouncement.java | 4 +- .../ldk/structs/UnsignedChannelUpdate.java | 13 +- .../ldk/structs/UnsignedNodeAnnouncement.java | 4 +- .../java/org/ldk/structs/UpdateAddHTLC.java | 2 +- .../java/org/ldk/structs/UpdateFailHTLC.java | 2 +- .../ldk/structs/UpdateFailMalformedHTLC.java | 2 +- src/main/java/org/ldk/structs/UpdateFee.java | 4 +- .../org/ldk/structs/UpdateFulfillHTLC.java | 4 +- src/main/java/org/ldk/structs/UserConfig.java | 12 +- .../java/org/ldk/structs/UtilMethods.java | 164 +- .../java/org/ldk/structs/WarningMessage.java | 4 +- src/main/java/org/ldk/structs/Watch.java | 32 +- .../java/org/ldk/structs/WatchedOutput.java | 6 +- src/main/jni/bindings.c | 33712 ++++++++-------- src/main/jni/bindings.c.body | 33712 ++++++++-------- src/main/jni/org_ldk_impl_bindings.h | 6718 +-- 279 files changed, 44817 insertions(+), 36736 deletions(-) create mode 100644 src/main/java/org/ldk/structs/BigSize.java rename src/main/java/org/ldk/structs/{FundingLocked.java => ChannelReady.java} (56%) create mode 100644 src/main/java/org/ldk/structs/ChannelUsage.java create mode 100644 src/main/java/org/ldk/structs/ExpandedKey.java create mode 100644 src/main/java/org/ldk/structs/GossipSync.java create mode 100644 src/main/java/org/ldk/structs/GraphSyncError.java rename src/main/java/org/ldk/structs/{NetGraphMsgHandler.java => P2PGossipSync.java} (68%) create mode 100644 src/main/java/org/ldk/structs/RapidGossipSync.java create mode 100644 src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_ScorerDecodeErrorZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_ScoringParametersDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Retry.java delete mode 100644 src/main/java/org/ldk/structs/RetryAttempts.java delete mode 100644 src/main/java/org/ldk/structs/Scorer.java delete mode 100644 src/main/java/org/ldk/structs/ScoringParameters.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorEventZZ.java diff --git a/src/main/java/org/ldk/enums/Secp256k1Error.java b/src/main/java/org/ldk/enums/Secp256k1Error.java index cca53632..6b50cc5e 100644 --- a/src/main/java/org/ldk/enums/Secp256k1Error.java +++ b/src/main/java/org/ldk/enums/Secp256k1Error.java @@ -24,6 +24,10 @@ public enum Secp256k1Error { * Bad secret key */ LDKSecp256k1Error_InvalidSecretKey, + /** + * Bad shared secret. + */ + LDKSecp256k1Error_InvalidSharedSecret, /** * Bad recovery id */ @@ -32,14 +36,18 @@ public enum Secp256k1Error { * Invalid tweak for add_assign or mul_assign */ LDKSecp256k1Error_InvalidTweak, - /** - * tweak_add_check failed on an xonly public key - */ - LDKSecp256k1Error_TweakCheckFailed, /** * Didn't pass enough memory to context creation with preallocated memory */ LDKSecp256k1Error_NotEnoughMemory, + /** + * Bad set of public keys. + */ + LDKSecp256k1Error_InvalidPublicKeySum, + /** + * The only valid parity values are 0 or 1. + */ + LDKSecp256k1Error_InvalidParityValue, ; static native void init(); static { init(); } } \ No newline at end of file diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 24f73377..e83231c6 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -242,54 +242,25 @@ public class bindings { public static native long CResult_RouteLightningErrorZ_get_ok(long owner); // struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); public static native long CResult_RouteLightningErrorZ_get_err(long owner); - // struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner); - public static native long CResult_TxOutAccessErrorZ_get_ok(long owner); - // enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner); - public static native AccessError CResult_TxOutAccessErrorZ_get_err(long owner); - // uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); - public static native long C2Tuple_usizeTransactionZ_get_a(long owner); - // struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); - public static native byte[] C2Tuple_usizeTransactionZ_get_b(long owner); - // void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner); - public static native void CResult_NoneChannelMonitorUpdateErrZ_get_ok(long owner); - // enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner); - public static native ChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(long owner); - public static class LDKMonitorEvent { - private LDKMonitorEvent() {} - public final static class HTLCEvent extends LDKMonitorEvent { - public long htlc_event; - HTLCEvent(long htlc_event) { this.htlc_event = htlc_event; } - } - public final static class CommitmentTxConfirmed extends LDKMonitorEvent { - public long commitment_tx_confirmed; - CommitmentTxConfirmed(long commitment_tx_confirmed) { this.commitment_tx_confirmed = commitment_tx_confirmed; } - } - public final static class UpdateCompleted extends LDKMonitorEvent { - public long funding_txo; - public long monitor_update_id; - UpdateCompleted(long funding_txo, long monitor_update_id) { this.funding_txo = funding_txo; this.monitor_update_id = monitor_update_id; } - } - public final static class UpdateFailed extends LDKMonitorEvent { - public long update_failed; - UpdateFailed(long update_failed) { this.update_failed = update_failed; } - } - static native void init(); - } - static { LDKMonitorEvent.init(); } - public static native LDKMonitorEvent LDKMonitorEvent_ref_from_ptr(long ptr); - public static class LDKCOption_C2Tuple_usizeTransactionZZ { - private LDKCOption_C2Tuple_usizeTransactionZZ() {} - public final static class Some extends LDKCOption_C2Tuple_usizeTransactionZZ { - public long some; - Some(long some) { this.some = some; } + public static class LDKPaymentPurpose { + private LDKPaymentPurpose() {} + public final static class InvoicePayment extends LDKPaymentPurpose { + public byte[] payment_preimage; + public byte[] payment_secret; + InvoicePayment(byte[] payment_preimage, byte[] payment_secret) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; } } - public final static class None extends LDKCOption_C2Tuple_usizeTransactionZZ { - None() { } + public final static class SpontaneousPayment extends LDKPaymentPurpose { + public byte[] spontaneous_payment; + SpontaneousPayment(byte[] spontaneous_payment) { this.spontaneous_payment = spontaneous_payment; } } static native void init(); } - static { LDKCOption_C2Tuple_usizeTransactionZZ.init(); } - public static native LDKCOption_C2Tuple_usizeTransactionZZ LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(long ptr); + static { LDKPaymentPurpose.init(); } + public static native LDKPaymentPurpose LDKPaymentPurpose_ref_from_ptr(long ptr); + // struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_PaymentPurposeDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_PaymentPurposeDecodeErrorZ_get_err(long owner); public static class LDKClosureReason { private LDKClosureReason() {} public final static class CounterpartyForceClosed extends LDKClosureReason { @@ -345,10 +316,10 @@ public class bindings { public long msg; ChannelUpdateMessage(long msg) { this.msg = msg; } } - public final static class ChannelClosed extends LDKNetworkUpdate { + public final static class ChannelFailure extends LDKNetworkUpdate { public long short_channel_id; public boolean is_permanent; - ChannelClosed(long short_channel_id, boolean is_permanent) { this.short_channel_id = short_channel_id; this.is_permanent = is_permanent; } + ChannelFailure(long short_channel_id, boolean is_permanent) { this.short_channel_id = short_channel_id; this.is_permanent = is_permanent; } } public final static class NodeFailure extends LDKNetworkUpdate { public byte[] node_id; @@ -391,35 +362,27 @@ public class bindings { } static { LDKSpendableOutputDescriptor.init(); } public static native LDKSpendableOutputDescriptor LDKSpendableOutputDescriptor_ref_from_ptr(long ptr); - public static class LDKPaymentPurpose { - private LDKPaymentPurpose() {} - public final static class InvoicePayment extends LDKPaymentPurpose { - public byte[] payment_preimage; - public byte[] payment_secret; - InvoicePayment(byte[] payment_preimage, byte[] payment_secret) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; } - } - public final static class SpontaneousPayment extends LDKPaymentPurpose { - public byte[] spontaneous_payment; - SpontaneousPayment(byte[] spontaneous_payment) { this.spontaneous_payment = spontaneous_payment; } - } - static native void init(); - } - static { LDKPaymentPurpose.init(); } - public static native LDKPaymentPurpose LDKPaymentPurpose_ref_from_ptr(long ptr); public static class LDKEvent { private LDKEvent() {} public final static class FundingGenerationReady extends LDKEvent { public byte[] temporary_channel_id; + public byte[] counterparty_node_id; public long channel_value_satoshis; public byte[] output_script; public long user_channel_id; - FundingGenerationReady(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } + FundingGenerationReady(byte[] temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.counterparty_node_id = counterparty_node_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } } public final static class PaymentReceived extends LDKEvent { public byte[] payment_hash; - public long amt; + public long amount_msat; + public long purpose; + PaymentReceived(byte[] payment_hash, long amount_msat, long purpose) { this.payment_hash = payment_hash; this.amount_msat = amount_msat; this.purpose = purpose; } + } + public final static class PaymentClaimed extends LDKEvent { + public byte[] payment_hash; + public long amount_msat; public long purpose; - PaymentReceived(byte[] payment_hash, long amt, long purpose) { this.payment_hash = payment_hash; this.amt = amt; this.purpose = purpose; } + PaymentClaimed(byte[] payment_hash, long amount_msat, long purpose) { this.payment_hash = payment_hash; this.amount_msat = amount_msat; this.purpose = purpose; } } public final static class PaymentSent extends LDKEvent { public byte[] payment_id; @@ -428,6 +391,17 @@ public class bindings { public long fee_paid_msat; PaymentSent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, long fee_paid_msat) { this.payment_id = payment_id; this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; this.fee_paid_msat = fee_paid_msat; } } + public final static class PaymentFailed extends LDKEvent { + public byte[] payment_id; + public byte[] payment_hash; + PaymentFailed(byte[] payment_id, byte[] payment_hash) { this.payment_id = payment_id; this.payment_hash = payment_hash; } + } + public final static class PaymentPathSuccessful extends LDKEvent { + public byte[] payment_id; + public byte[] payment_hash; + public long[] path; + PaymentPathSuccessful(byte[] payment_id, byte[] payment_hash, long[] path) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.path = path; } + } public final static class PaymentPathFailed extends LDKEvent { public byte[] payment_id; public byte[] payment_hash; @@ -439,11 +413,6 @@ public class bindings { public long retry; PaymentPathFailed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, long network_update, boolean all_paths_failed, long[] path, long short_channel_id, long retry) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; this.network_update = network_update; this.all_paths_failed = all_paths_failed; this.path = path; this.short_channel_id = short_channel_id; this.retry = retry; } } - public final static class PaymentFailed extends LDKEvent { - public byte[] payment_id; - public byte[] payment_hash; - PaymentFailed(byte[] payment_id, byte[] payment_hash) { this.payment_id = payment_id; this.payment_hash = payment_hash; } - } public final static class PendingHTLCsForwardable extends LDKEvent { public long time_forwardable; PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; } @@ -453,9 +422,11 @@ public class bindings { SpendableOutputs(long[] outputs) { this.outputs = outputs; } } public final static class PaymentForwarded extends LDKEvent { + public byte[] prev_channel_id; + public byte[] next_channel_id; public long fee_earned_msat; public boolean claim_from_onchain_tx; - PaymentForwarded(long fee_earned_msat, boolean claim_from_onchain_tx) { this.fee_earned_msat = fee_earned_msat; this.claim_from_onchain_tx = claim_from_onchain_tx; } + PaymentForwarded(byte[] prev_channel_id, byte[] next_channel_id, long fee_earned_msat, boolean claim_from_onchain_tx) { this.prev_channel_id = prev_channel_id; this.next_channel_id = next_channel_id; this.fee_earned_msat = fee_earned_msat; this.claim_from_onchain_tx = claim_from_onchain_tx; } } public final static class ChannelClosed extends LDKEvent { public byte[] channel_id; @@ -468,12 +439,6 @@ public class bindings { public byte[] transaction; DiscardFunding(byte[] channel_id, byte[] transaction) { this.channel_id = channel_id; this.transaction = transaction; } } - public final static class PaymentPathSuccessful extends LDKEvent { - public byte[] payment_id; - public byte[] payment_hash; - public long[] path; - PaymentPathSuccessful(byte[] payment_id, byte[] payment_hash, long[] path) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.path = path; } - } public final static class OpenChannelRequest extends LDKEvent { public byte[] temporary_channel_id; public byte[] counterparty_node_id; @@ -554,10 +519,10 @@ public class bindings { public long msg; SendFundingSigned(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; } } - public final static class SendFundingLocked extends LDKMessageSendEvent { + public final static class SendChannelReady extends LDKMessageSendEvent { public byte[] node_id; public long msg; - SendFundingLocked(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; } + SendChannelReady(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; } } public final static class SendAnnouncementSignatures extends LDKMessageSendEvent { public byte[] node_id; @@ -636,18 +601,66 @@ public class bindings { } static { LDKMessageSendEvent.init(); } public static native LDKMessageSendEvent LDKMessageSendEvent_ref_from_ptr(long ptr); + // struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner); + public static native long CResult_TxOutAccessErrorZ_get_ok(long owner); + // enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner); + public static native AccessError CResult_TxOutAccessErrorZ_get_err(long owner); + // uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); + public static native long C2Tuple_usizeTransactionZ_get_a(long owner); + // struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); + public static native byte[] C2Tuple_usizeTransactionZ_get_b(long owner); + // void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner); + public static native void CResult_NoneChannelMonitorUpdateErrZ_get_ok(long owner); + // enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner); + public static native ChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(long owner); + public static class LDKMonitorEvent { + private LDKMonitorEvent() {} + public final static class HTLCEvent extends LDKMonitorEvent { + public long htlc_event; + HTLCEvent(long htlc_event) { this.htlc_event = htlc_event; } + } + public final static class CommitmentTxConfirmed extends LDKMonitorEvent { + public long commitment_tx_confirmed; + CommitmentTxConfirmed(long commitment_tx_confirmed) { this.commitment_tx_confirmed = commitment_tx_confirmed; } + } + public final static class UpdateCompleted extends LDKMonitorEvent { + public long funding_txo; + public long monitor_update_id; + UpdateCompleted(long funding_txo, long monitor_update_id) { this.funding_txo = funding_txo; this.monitor_update_id = monitor_update_id; } + } + public final static class UpdateFailed extends LDKMonitorEvent { + public long update_failed; + UpdateFailed(long update_failed) { this.update_failed = update_failed; } + } + static native void init(); + } + static { LDKMonitorEvent.init(); } + public static native LDKMonitorEvent LDKMonitorEvent_ref_from_ptr(long ptr); + // struct LDKOutPoint C2Tuple_OutPointCVec_MonitorEventZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR owner); + public static native long C2Tuple_OutPointCVec_MonitorEventZZ_get_a(long owner); + // struct LDKCVec_MonitorEventZ C2Tuple_OutPointCVec_MonitorEventZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR owner); + public static native long[] C2Tuple_OutPointCVec_MonitorEventZZ_get_b(long owner); + public static class LDKCOption_C2Tuple_usizeTransactionZZ { + private LDKCOption_C2Tuple_usizeTransactionZZ() {} + public final static class Some extends LDKCOption_C2Tuple_usizeTransactionZZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_C2Tuple_usizeTransactionZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_C2Tuple_usizeTransactionZZ.init(); } + public static native LDKCOption_C2Tuple_usizeTransactionZZ LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(long ptr); // struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_FixedPenaltyScorerDecodeErrorZ_get_err(long owner); - // struct LDKScoringParameters CResult_ScoringParametersDecodeErrorZ_get_ok(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ScoringParametersDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_ScoringParametersDecodeErrorZ_get_err(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ScoringParametersDecodeErrorZ_get_err(long owner); - // struct LDKScorer *CResult_ScorerDecodeErrorZ_get_ok(LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ScorerDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_ScorerDecodeErrorZ_get_err(LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ScorerDecodeErrorZ_get_err(long owner); + public interface LDKLogger { + void log(long record); + } + public static native long LDKLogger_new(LDKLogger impl); // struct LDKProbabilisticScorer *CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_ProbabilisticScorerDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner); @@ -672,6 +685,111 @@ public class bindings { 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 LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NodeIdDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NodeIdDecodeErrorZ_get_err(long owner); + // struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(long owner); + public interface LDKAccess { + long get_utxo(byte[] genesis_hash, long short_channel_id); + } + public static native long LDKAccess_new(LDKAccess impl); + // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess *NONNULL_PTR this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id + public static native long Access_get_utxo(long this_arg, byte[] genesis_hash, long short_channel_id); + public static class LDKCOption_AccessZ { + private LDKCOption_AccessZ() {} + public final static class Some extends LDKCOption_AccessZ { + public long some; + Some(long some) { this.some = some; } + } + public final static class None extends LDKCOption_AccessZ { + None() { } + } + static native void init(); + } + static { LDKCOption_AccessZ.init(); } + public static native LDKCOption_AccessZ LDKCOption_AccessZ_ref_from_ptr(long ptr); + // bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); + public static native boolean CResult_boolLightningErrorZ_get_ok(long owner); + // struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); + public static native long CResult_boolLightningErrorZ_get_err(long owner); + // struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); + public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long owner); + // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); + public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long owner); + // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); + public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long owner); + // void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); + public static native void CResult_NoneLightningErrorZ_get_ok(long owner); + // struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); + public static native long CResult_NoneLightningErrorZ_get_err(long owner); + // struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelUpdateInfoDecodeErrorZ_get_err(long owner); + // struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelInfoDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelInfoDecodeErrorZ_get_err(long owner); + // struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RoutingFeesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RoutingFeesDecodeErrorZ_get_err(long owner); + public static class LDKNetAddress { + private LDKNetAddress() {} + public final static class IPv4 extends LDKNetAddress { + public byte[] addr; + public short port; + IPv4(byte[] addr, short port) { this.addr = addr; this.port = port; } + } + public final static class IPv6 extends LDKNetAddress { + public byte[] addr; + public short port; + IPv6(byte[] addr, short port) { this.addr = addr; this.port = port; } + } + public final static class OnionV2 extends LDKNetAddress { + public byte[] onion_v2; + OnionV2(byte[] onion_v2) { this.onion_v2 = onion_v2; } + } + public final static class OnionV3 extends LDKNetAddress { + public byte[] ed25519_pubkey; + public short checksum; + public byte version; + public short port; + OnionV3(byte[] ed25519_pubkey, short checksum, byte version, short port) { this.ed25519_pubkey = ed25519_pubkey; this.checksum = checksum; this.version = version; this.port = port; } + } + static native void init(); + } + static { LDKNetAddress.init(); } + public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); + // struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(long owner); + // struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NodeInfoDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NodeInfoDecodeErrorZ_get_err(long owner); + // struct LDKNetworkGraph *CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NetworkGraphDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_NetworkGraphDecodeErrorZ_get_err(long owner); + public static class LDKCOption_CVec_NetAddressZZ { + private LDKCOption_CVec_NetAddressZZ() {} + public final static class Some extends LDKCOption_CVec_NetAddressZZ { + public long[] some; + Some(long[] some) { this.some = some; } + } + public final static class None extends LDKCOption_CVec_NetAddressZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_CVec_NetAddressZZ.init(); } + public static native LDKCOption_CVec_NetAddressZZ LDKCOption_CVec_NetAddressZZ_ref_from_ptr(long ptr); // struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); @@ -878,33 +996,6 @@ public class bindings { public static native long CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(long owner); // struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner); public static native long CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(long owner); - public static class LDKNetAddress { - private LDKNetAddress() {} - public final static class IPv4 extends LDKNetAddress { - public byte[] addr; - public short port; - IPv4(byte[] addr, short port) { this.addr = addr; this.port = port; } - } - public final static class IPv6 extends LDKNetAddress { - public byte[] addr; - public short port; - IPv6(byte[] addr, short port) { this.addr = addr; this.port = port; } - } - public final static class OnionV2 extends LDKNetAddress { - public byte[] onion_v2; - OnionV2(byte[] onion_v2) { this.onion_v2 = onion_v2; } - } - public final static class OnionV3 extends LDKNetAddress { - public byte[] ed25519_pubkey; - public short checksum; - public byte version; - public short port; - OnionV3(byte[] ed25519_pubkey, short checksum, byte version, short port) { this.ed25519_pubkey = ed25519_pubkey; this.checksum = checksum; this.version = version; this.port = port; } - } - static native void init(); - } - static { LDKNetAddress.init(); } - public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner); public static native byte[] C2Tuple_PaymentHashPaymentSecretZ_get_a(long owner); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner); @@ -955,7 +1046,7 @@ public class bindings { public static native long Watch_watch_channel(long this_arg, long funding_txo, long monitor); // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update public static native long Watch_update_channel(long this_arg, long funding_txo, long update); - // LDKCVec_MonitorEventZ Watch_release_pending_monitor_events LDKWatch *NONNULL_PTR this_arg + // LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ Watch_release_pending_monitor_events LDKWatch *NONNULL_PTR this_arg public static native long[] Watch_release_pending_monitor_events(long this_arg); public interface LDKBroadcasterInterface { void broadcast_transaction(byte[] tx); @@ -996,10 +1087,6 @@ 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 LDKLogger { - void log(long record); - } - public static native long LDKLogger_new(LDKLogger impl); // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner); public static native byte[] C2Tuple_BlockHashChannelManagerZ_get_a(long owner); // struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner); @@ -1266,113 +1353,53 @@ public class bindings { public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(long owner); - // void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); - public static native void CResult_NoneLightningErrorZ_get_ok(long owner); - // struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); - public static native long CResult_NoneLightningErrorZ_get_err(long owner); // struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner); public static native byte[] C2Tuple_PublicKeyTypeZ_get_a(long owner); // struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner); - public static native long C2Tuple_PublicKeyTypeZ_get_b(long owner); - // bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); - public static native boolean CResult_boolLightningErrorZ_get_ok(long owner); - // struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); - public static native long CResult_boolLightningErrorZ_get_err(long owner); - // struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); - public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long owner); - // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); - public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long owner); - // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); - public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long owner); - public static class LDKCOption_NetAddressZ { - private LDKCOption_NetAddressZ() {} - public final static class Some extends LDKCOption_NetAddressZ { - public long some; - Some(long some) { this.some = some; } - } - public final static class None extends LDKCOption_NetAddressZ { - None() { } - } - static native void init(); - } - static { LDKCOption_NetAddressZ.init(); } - public static native LDKCOption_NetAddressZ LDKCOption_NetAddressZ_ref_from_ptr(long ptr); - // struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); - public static native byte[] CResult_CVec_u8ZPeerHandleErrorZ_get_ok(long owner); - // struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); - public static native long CResult_CVec_u8ZPeerHandleErrorZ_get_err(long owner); - // void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner); - public static native void CResult_NonePeerHandleErrorZ_get_ok(long owner); - // struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner); - public static native long CResult_NonePeerHandleErrorZ_get_err(long owner); - // bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner); - public static native boolean CResult_boolPeerHandleErrorZ_get_ok(long owner); - // struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner); - public static native long CResult_boolPeerHandleErrorZ_get_err(long owner); - // struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NodeIdDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NodeIdDecodeErrorZ_get_err(long owner); - // struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(long owner); - public interface LDKAccess { - long get_utxo(byte[] genesis_hash, long short_channel_id); - } - public static native long LDKAccess_new(LDKAccess impl); - // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess *NONNULL_PTR this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id - public static native long Access_get_utxo(long this_arg, byte[] genesis_hash, long short_channel_id); - public static class LDKCOption_AccessZ { - private LDKCOption_AccessZ() {} - public final static class Some extends LDKCOption_AccessZ { + public static native long C2Tuple_PublicKeyTypeZ_get_b(long owner); + public static class LDKCOption_NetAddressZ { + private LDKCOption_NetAddressZ() {} + public final static class Some extends LDKCOption_NetAddressZ { public long some; Some(long some) { this.some = some; } } - public final static class None extends LDKCOption_AccessZ { + public final static class None extends LDKCOption_NetAddressZ { None() { } } static native void init(); } - static { LDKCOption_AccessZ.init(); } - public static native LDKCOption_AccessZ LDKCOption_AccessZ_ref_from_ptr(long ptr); - // struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelUpdateInfoDecodeErrorZ_get_err(long owner); - // struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelInfoDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelInfoDecodeErrorZ_get_err(long owner); - // struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_RoutingFeesDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_RoutingFeesDecodeErrorZ_get_err(long owner); - // struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(long owner); - // struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NodeInfoDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NodeInfoDecodeErrorZ_get_err(long owner); - // struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NetworkGraphDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_NetworkGraphDecodeErrorZ_get_err(long owner); - public static class LDKCOption_CVec_NetAddressZZ { - private LDKCOption_CVec_NetAddressZZ() {} - public final static class Some extends LDKCOption_CVec_NetAddressZZ { - public long[] some; - Some(long[] some) { this.some = some; } + static { LDKCOption_NetAddressZ.init(); } + public static native LDKCOption_NetAddressZ LDKCOption_NetAddressZ_ref_from_ptr(long ptr); + // struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); + public static native byte[] CResult_CVec_u8ZPeerHandleErrorZ_get_ok(long owner); + // struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); + public static native long CResult_CVec_u8ZPeerHandleErrorZ_get_err(long owner); + // void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner); + public static native void CResult_NonePeerHandleErrorZ_get_ok(long owner); + // struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner); + public static native long CResult_NonePeerHandleErrorZ_get_err(long owner); + // bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner); + public static native boolean CResult_boolPeerHandleErrorZ_get_ok(long owner); + // struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner); + public static native long CResult_boolPeerHandleErrorZ_get_err(long owner); + public static class LDKGraphSyncError { + private LDKGraphSyncError() {} + public final static class DecodeError extends LDKGraphSyncError { + public long decode_error; + DecodeError(long decode_error) { this.decode_error = decode_error; } } - public final static class None extends LDKCOption_CVec_NetAddressZZ { - None() { } + public final static class LightningError extends LDKGraphSyncError { + public long lightning_error; + LightningError(long lightning_error) { this.lightning_error = lightning_error; } } static native void init(); } - static { LDKCOption_CVec_NetAddressZZ.init(); } - public static native LDKCOption_CVec_NetAddressZZ LDKCOption_CVec_NetAddressZZ_ref_from_ptr(long ptr); + static { LDKGraphSyncError.init(); } + public static native LDKGraphSyncError LDKGraphSyncError_ref_from_ptr(long ptr); + // uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner); + public static native int CResult_u32GraphSyncErrorZ_get_ok(long owner); + // struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner); + public static native long CResult_u32GraphSyncErrorZ_get_err(long owner); // struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_NetAddressDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner); @@ -1409,10 +1436,10 @@ public class bindings { public static native long CResult_FundingSignedDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_FundingSignedDecodeErrorZ_get_err(long owner); - // struct LDKFundingLocked CResult_FundingLockedDecodeErrorZ_get_ok(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_FundingLockedDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_FundingLockedDecodeErrorZ_get_err(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_FundingLockedDecodeErrorZ_get_err(long owner); + // struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelReadyDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelReadyDecodeErrorZ_get_err(long owner); // struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_InitDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner); @@ -1570,11 +1597,41 @@ 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 LDKScore { + long channel_penalty_msat(long short_channel_id, long source, long target, long usage); + void payment_path_failed(long[] path, long short_channel_id); + void payment_path_successful(long[] path); + byte[] write(); + } + public static native long LDKScore_new(LDKScore impl); + // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, struct LDKChannelUsage usage + public static native long Score_channel_penalty_msat(long this_arg, long short_channel_id, long source, long target, long usage); + // void Score_payment_path_failed LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id + public static native void Score_payment_path_failed(long this_arg, long[] path, long short_channel_id); + // void Score_payment_path_successful LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path + public static native void Score_payment_path_successful(long this_arg, long[] path); + // LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg + public static native byte[] Score_write(long this_arg); + public interface LDKPersister { + long persist_manager(long channel_manager); + long persist_graph(long network_graph); + long persist_scorer(long scorer); + } + public static native long LDKPersister_new(LDKPersister impl); + // LDKCResult_NoneErrorZ Persister_persist_manager LDKPersister *NONNULL_PTR this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager + public static native long Persister_persist_manager(long this_arg, long channel_manager); + // LDKCResult_NoneErrorZ Persister_persist_graph LDKPersister *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph + public static native long Persister_persist_graph(long this_arg, long network_graph); + // LDKCResult_NoneErrorZ Persister_persist_scorer LDKPersister *NONNULL_PTR this_arg, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer + public static native long Persister_persist_scorer(long this_arg, long scorer); public interface LDKListen { + void filtered_block_connected(byte[] header, long[] txdata, int height); void block_connected(byte[] block, int height); void block_disconnected(byte[] header, int height); } public static native long LDKListen_new(LDKListen impl); + // void Listen_filtered_block_connected LDKListen *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height + public static native void Listen_filtered_block_connected(long this_arg, byte[] header, long[] txdata, int height); // void Listen_block_connected LDKListen *NONNULL_PTR this_arg, struct LDKu8slice block, uint32_t height public static native void Listen_block_connected(long this_arg, byte[] block, int height); // void Listen_block_disconnected LDKListen *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height @@ -1608,7 +1665,7 @@ public class bindings { void handle_accept_channel(byte[] their_node_id, long their_features, long msg); void handle_funding_created(byte[] their_node_id, long msg); void handle_funding_signed(byte[] their_node_id, long msg); - void handle_funding_locked(byte[] their_node_id, long msg); + void handle_channel_ready(byte[] their_node_id, long msg); void handle_shutdown(byte[] their_node_id, long their_features, long msg); void handle_closing_signed(byte[] their_node_id, long msg); void handle_update_add_htlc(byte[] their_node_id, long msg); @@ -1635,8 +1692,8 @@ public class bindings { public static native void ChannelMessageHandler_handle_funding_created(long this_arg, byte[] their_node_id, long msg); // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_funding_signed(long this_arg, byte[] their_node_id, long msg); - // void ChannelMessageHandler_handle_funding_locked LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_funding_locked(long this_arg, byte[] their_node_id, long msg); + // void ChannelMessageHandler_handle_channel_ready LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg + public static native void ChannelMessageHandler_handle_channel_ready(long this_arg, byte[] their_node_id, long msg); // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg public static native void ChannelMessageHandler_handle_shutdown(long this_arg, byte[] their_node_id, long their_features, long msg); // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg @@ -1754,36 +1811,29 @@ public class bindings { } static { LDKEffectiveCapacity.init(); } public static native LDKEffectiveCapacity LDKEffectiveCapacity_ref_from_ptr(long ptr); - public interface LDKScore { - long channel_penalty_msat(long short_channel_id, long send_amt_msat, long capacity_msat, long source, long target); - void payment_path_failed(long[] path, long short_channel_id); - void payment_path_successful(long[] path); - byte[] write(); - } - public static native long LDKScore_new(LDKScore impl); - // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, uint64_t capacity_msat, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target - public static native long Score_channel_penalty_msat(long this_arg, long short_channel_id, long send_amt_msat, long capacity_msat, long source, long target); - // void Score_payment_path_failed LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id - public static native void Score_payment_path_failed(long this_arg, long[] path, long short_channel_id); - // void Score_payment_path_successful LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path - public static native void Score_payment_path_successful(long this_arg, long[] path); - // LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg - public static native byte[] Score_write(long this_arg); public interface LDKLockableScore { long lock(); } public static native long LDKLockableScore_new(LDKLockableScore impl); // LDKScore LockableScore_lock LDKLockableScore *NONNULL_PTR this_arg public static native long LockableScore_lock(long this_arg); - public interface LDKPersister { - long persist_manager(long channel_manager); - long persist_graph(long network_graph); + public static class LDKGossipSync { + private LDKGossipSync() {} + public final static class P2P extends LDKGossipSync { + public long p2p; + P2P(long p2p) { this.p2p = p2p; } + } + public final static class Rapid extends LDKGossipSync { + public long rapid; + Rapid(long rapid) { this.rapid = rapid; } + } + public final static class None extends LDKGossipSync { + None() { } + } + static native void init(); } - public static native long LDKPersister_new(LDKPersister impl); - // LDKCResult_NoneErrorZ Persister_persist_manager LDKPersister *NONNULL_PTR this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager - public static native long Persister_persist_manager(long this_arg, long channel_manager); - // LDKCResult_NoneErrorZ Persister_persist_graph LDKPersister *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph - public static native long Persister_persist_graph(long this_arg, long network_graph); + static { LDKGossipSync.init(); } + public static native LDKGossipSync LDKGossipSync_ref_from_ptr(long ptr); public static class LDKFallback { private LDKFallback() {} public final static class SegWitProgram extends LDKFallback { @@ -1830,6 +1880,20 @@ public class bindings { 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, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer public static native long Router_find_route(long this_arg, byte[] payer, long route_params, byte[] payment_hash, long[] first_hops, long scorer); + public static class LDKRetry { + private LDKRetry() {} + public final static class Attempts extends LDKRetry { + public long attempts; + Attempts(long attempts) { this.attempts = attempts; } + } + public final static class Timeout extends LDKRetry { + public long timeout; + Timeout(long timeout) { this.timeout = timeout; } + } + static native void init(); + } + static { LDKRetry.init(); } + public static native LDKRetry LDKRetry_ref_from_ptr(long ptr); // struct LDKStr _ldk_get_compiled_version(void); public static native String _ldk_get_compiled_version(); // struct LDKStr _ldk_c_bindings_get_compiled_version(void); @@ -2194,54 +2258,20 @@ public class bindings { public static native long CResult_RouteLightningErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); public static native long CResult_RouteLightningErrorZ_clone(long orig); - // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o); - public static native long CResult_TxOutAccessErrorZ_ok(long o); - // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e); - public static native long CResult_TxOutAccessErrorZ_err(AccessError e); - // bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o); - public static native boolean CResult_TxOutAccessErrorZ_is_ok(long o); - // void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); - public static native void CResult_TxOutAccessErrorZ_free(long _res); - // uintptr_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg); - public static native long CResult_TxOutAccessErrorZ_clone_ptr(long arg); - // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); - public static native long CResult_TxOutAccessErrorZ_clone(long orig); - // uintptr_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg); - public static native long C2Tuple_usizeTransactionZ_clone_ptr(long arg); - // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig); - public static native long C2Tuple_usizeTransactionZ_clone(long orig); - // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); - public static native long C2Tuple_usizeTransactionZ_new(long a, byte[] b); - // void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res); - public static native void C2Tuple_usizeTransactionZ_free(long _res); - // void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res); - public static native void CVec_C2Tuple_usizeTransactionZZ_free(long[] _res); - // void CVec_TxidZ_free(struct LDKCVec_TxidZ _res); - public static native void CVec_TxidZ_free(byte[][] _res); - // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void); - public static native long CResult_NoneChannelMonitorUpdateErrZ_ok(); - // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e); - public static native long CResult_NoneChannelMonitorUpdateErrZ_err(ChannelMonitorUpdateErr e); - // bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o); - public static native boolean CResult_NoneChannelMonitorUpdateErrZ_is_ok(long o); - // void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res); - public static native void CResult_NoneChannelMonitorUpdateErrZ_free(long _res); - // uintptr_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg); - public static native long CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(long arg); - // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig); - public static native long CResult_NoneChannelMonitorUpdateErrZ_clone(long orig); - // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); - public static native void CVec_MonitorEventZ_free(long[] _res); - // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o); - public static native long COption_C2Tuple_usizeTransactionZZ_some(long o); - // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void); - public static native long COption_C2Tuple_usizeTransactionZZ_none(); - // void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res); - public static native void COption_C2Tuple_usizeTransactionZZ_free(long _res); - // uintptr_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg); - public static native long COption_C2Tuple_usizeTransactionZZ_clone_ptr(long arg); - // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig); - public static native long COption_C2Tuple_usizeTransactionZZ_clone(long orig); + // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); + public static native void CVec_PublicKeyZ_free(byte[][] _res); + // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o); + public static native long CResult_PaymentPurposeDecodeErrorZ_ok(long o); + // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_PaymentPurposeDecodeErrorZ_err(long e); + // bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_PaymentPurposeDecodeErrorZ_is_ok(long o); + // void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res); + public static native void CResult_PaymentPurposeDecodeErrorZ_free(long _res); + // uintptr_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_PaymentPurposeDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_PaymentPurposeDecodeErrorZ_clone(long orig); // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o); public static native long COption_ClosureReasonZ_some(long o); // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void); @@ -2300,6 +2330,64 @@ public class bindings { public static native long CResult_COption_EventZDecodeErrorZ_clone(long orig); // void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); public static native void CVec_MessageSendEventZ_free(long[] _res); + // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o); + public static native long CResult_TxOutAccessErrorZ_ok(long o); + // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e); + public static native long CResult_TxOutAccessErrorZ_err(AccessError e); + // bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o); + public static native boolean CResult_TxOutAccessErrorZ_is_ok(long o); + // void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); + public static native void CResult_TxOutAccessErrorZ_free(long _res); + // uintptr_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg); + public static native long CResult_TxOutAccessErrorZ_clone_ptr(long arg); + // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); + public static native long CResult_TxOutAccessErrorZ_clone(long orig); + // uintptr_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg); + public static native long C2Tuple_usizeTransactionZ_clone_ptr(long arg); + // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig); + public static native long C2Tuple_usizeTransactionZ_clone(long orig); + // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); + public static native long C2Tuple_usizeTransactionZ_new(long a, byte[] b); + // void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res); + public static native void C2Tuple_usizeTransactionZ_free(long _res); + // void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res); + public static native void CVec_C2Tuple_usizeTransactionZZ_free(long[] _res); + // void CVec_TxidZ_free(struct LDKCVec_TxidZ _res); + public static native void CVec_TxidZ_free(byte[][] _res); + // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void); + public static native long CResult_NoneChannelMonitorUpdateErrZ_ok(); + // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e); + public static native long CResult_NoneChannelMonitorUpdateErrZ_err(ChannelMonitorUpdateErr e); + // bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o); + public static native boolean CResult_NoneChannelMonitorUpdateErrZ_is_ok(long o); + // void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res); + public static native void CResult_NoneChannelMonitorUpdateErrZ_free(long _res); + // uintptr_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg); + public static native long CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(long arg); + // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig); + public static native long CResult_NoneChannelMonitorUpdateErrZ_clone(long orig); + // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); + public static native void CVec_MonitorEventZ_free(long[] _res); + // uintptr_t C2Tuple_OutPointCVec_MonitorEventZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR arg); + public static native long C2Tuple_OutPointCVec_MonitorEventZZ_clone_ptr(long arg); + // struct LDKC2Tuple_OutPointCVec_MonitorEventZZ C2Tuple_OutPointCVec_MonitorEventZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR orig); + public static native long C2Tuple_OutPointCVec_MonitorEventZZ_clone(long orig); + // struct LDKC2Tuple_OutPointCVec_MonitorEventZZ C2Tuple_OutPointCVec_MonitorEventZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b); + public static native long C2Tuple_OutPointCVec_MonitorEventZZ_new(long a, long[] b); + // void C2Tuple_OutPointCVec_MonitorEventZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorEventZZ _res); + public static native void C2Tuple_OutPointCVec_MonitorEventZZ_free(long _res); + // void CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ _res); + public static native void CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free(long[] _res); + // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o); + public static native long COption_C2Tuple_usizeTransactionZZ_some(long o); + // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void); + public static native long COption_C2Tuple_usizeTransactionZZ_none(); + // void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res); + public static native void COption_C2Tuple_usizeTransactionZZ_free(long _res); + // uintptr_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg); + public static native long COption_C2Tuple_usizeTransactionZZ_clone_ptr(long arg); + // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig); + public static native long COption_C2Tuple_usizeTransactionZZ_clone(long orig); // 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); @@ -2312,26 +2400,6 @@ public class bindings { public static native long CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_FixedPenaltyScorerDecodeErrorZ_clone(long orig); - // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o); - public static native long CResult_ScoringParametersDecodeErrorZ_ok(long o); - // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_ScoringParametersDecodeErrorZ_err(long e); - // bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_ScoringParametersDecodeErrorZ_is_ok(long o); - // void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res); - public static native void CResult_ScoringParametersDecodeErrorZ_free(long _res); - // uintptr_t CResult_ScoringParametersDecodeErrorZ_clone_ptr(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_ScoringParametersDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_clone(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_ScoringParametersDecodeErrorZ_clone(long orig); - // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o); - public static native long CResult_ScorerDecodeErrorZ_ok(long o); - // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_ScorerDecodeErrorZ_err(long e); - // bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_ScorerDecodeErrorZ_is_ok(long o); - // void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res); - public static native void CResult_ScorerDecodeErrorZ_free(long _res); // struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o); public static native long CResult_ProbabilisticScorerDecodeErrorZ_ok(long o); // struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e); @@ -2348,6 +2416,10 @@ public class bindings { 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); + // uintptr_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); @@ -2356,6 +2428,10 @@ public class bindings { 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); + // uintptr_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); @@ -2364,6 +2440,10 @@ public class bindings { 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); + // uintptr_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_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o); public static native long CResult_InvoiceFeaturesDecodeErrorZ_ok(long o); // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); @@ -2372,6 +2452,10 @@ public class bindings { public static native boolean CResult_InvoiceFeaturesDecodeErrorZ_is_ok(long o); // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res); public static native void CResult_InvoiceFeaturesDecodeErrorZ_free(long _res); + // uintptr_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_InvoiceFeaturesDecodeErrorZ_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); @@ -2380,6 +2464,158 @@ public class bindings { 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); + // uintptr_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_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o); + public static native long CResult_NodeIdDecodeErrorZ_ok(long o); + // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_NodeIdDecodeErrorZ_err(long e); + // bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NodeIdDecodeErrorZ_is_ok(long o); + // void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res); + public static native void CResult_NodeIdDecodeErrorZ_free(long _res); + // uintptr_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NodeIdDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_NodeIdDecodeErrorZ_clone(long orig); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_ok(long o); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_err(long e); + // bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(long o); + // void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res); + public static native void CResult_COption_NetworkUpdateZDecodeErrorZ_free(long _res); + // uintptr_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_clone(long orig); + // struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o); + public static native long COption_AccessZ_some(long o); + // struct LDKCOption_AccessZ COption_AccessZ_none(void); + public static native long COption_AccessZ_none(); + // void COption_AccessZ_free(struct LDKCOption_AccessZ _res); + public static native void COption_AccessZ_free(long _res); + // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); + public static native long CResult_boolLightningErrorZ_ok(boolean o); + // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); + public static native long CResult_boolLightningErrorZ_err(long e); + // bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o); + public static native boolean CResult_boolLightningErrorZ_is_ok(long o); + // void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); + public static native void CResult_boolLightningErrorZ_free(long _res); + // uintptr_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg); + public static native long CResult_boolLightningErrorZ_clone_ptr(long arg); + // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig); + public static native long CResult_boolLightningErrorZ_clone(long orig); + // uintptr_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg); + public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(long arg); + // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig); + public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(long orig); + // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); + public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(long a, long b, long c); + // void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); + public static native void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(long _res); + // void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); + public static native void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(long[] _res); + // void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res); + public static native void CVec_NodeAnnouncementZ_free(long[] _res); + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); + public static native long CResult_NoneLightningErrorZ_ok(); + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); + public static native long CResult_NoneLightningErrorZ_err(long e); + // bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneLightningErrorZ_is_ok(long o); + // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); + public static native void CResult_NoneLightningErrorZ_free(long _res); + // uintptr_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneLightningErrorZ_clone_ptr(long arg); + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); + public static native long CResult_NoneLightningErrorZ_clone(long orig); + // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o); + public static native long CResult_ChannelUpdateInfoDecodeErrorZ_ok(long o); + // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChannelUpdateInfoDecodeErrorZ_err(long e); + // bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(long o); + // void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res); + public static native void CResult_ChannelUpdateInfoDecodeErrorZ_free(long _res); + // uintptr_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_ChannelUpdateInfoDecodeErrorZ_clone(long orig); + // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o); + public static native long CResult_ChannelInfoDecodeErrorZ_ok(long o); + // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChannelInfoDecodeErrorZ_err(long e); + // bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelInfoDecodeErrorZ_is_ok(long o); + // void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res); + public static native void CResult_ChannelInfoDecodeErrorZ_free(long _res); + // uintptr_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelInfoDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_ChannelInfoDecodeErrorZ_clone(long orig); + // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); + public static native long CResult_RoutingFeesDecodeErrorZ_ok(long o); + // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_RoutingFeesDecodeErrorZ_err(long e); + // bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_RoutingFeesDecodeErrorZ_is_ok(long o); + // void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); + public static native void CResult_RoutingFeesDecodeErrorZ_free(long _res); + // uintptr_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_RoutingFeesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_RoutingFeesDecodeErrorZ_clone(long orig); + // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); + public static native void CVec_NetAddressZ_free(long[] _res); + // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); + public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_ok(long o); + // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_err(long e); + // bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(long o); + // void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); + public static native void CResult_NodeAnnouncementInfoDecodeErrorZ_free(long _res); + // uintptr_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_clone(long orig); + // void CVec_u64Z_free(struct LDKCVec_u64Z _res); + public static native void CVec_u64Z_free(long[] _res); + // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); + public static native long CResult_NodeInfoDecodeErrorZ_ok(long o); + // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_NodeInfoDecodeErrorZ_err(long e); + // bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NodeInfoDecodeErrorZ_is_ok(long o); + // void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); + public static native void CResult_NodeInfoDecodeErrorZ_free(long _res); + // uintptr_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_NodeInfoDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_NodeInfoDecodeErrorZ_clone(long orig); + // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); + public static native long CResult_NetworkGraphDecodeErrorZ_ok(long o); + // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_NetworkGraphDecodeErrorZ_err(long e); + // bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_NetworkGraphDecodeErrorZ_is_ok(long o); + // void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); + public static native void CResult_NetworkGraphDecodeErrorZ_free(long _res); + // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o); + public static native long COption_CVec_NetAddressZZ_some(long[] o); + // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void); + public static native long COption_CVec_NetAddressZZ_none(); + // void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res); + public static native void COption_CVec_NetAddressZZ_free(long _res); + // uintptr_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg); + public static native long COption_CVec_NetAddressZZ_clone_ptr(long arg); + // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig); + public static native long COption_CVec_NetAddressZZ_clone(long orig); // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o); public static native long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(long o); // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); @@ -2654,8 +2890,6 @@ public class bindings { public static native long CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(long arg); // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig); public static native long CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(long orig); - // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); - public static native void CVec_NetAddressZ_free(long[] _res); // uintptr_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg); public static native long C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(long arg); // struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig); @@ -2970,6 +3204,10 @@ public class bindings { public static native boolean CResult_StringErrorZ_is_ok(long o); // void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res); public static native void CResult_StringErrorZ_free(long _res); + // uintptr_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg); + public static native long CResult_StringErrorZ_clone_ptr(long arg); + // struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig); + public static native long CResult_StringErrorZ_clone(long orig); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o); public static native long CResult_ChannelMonitorUpdateDecodeErrorZ_ok(long o); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e); @@ -3082,18 +3320,6 @@ public class bindings { public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(long orig); - // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); - public static native long CResult_NoneLightningErrorZ_ok(); - // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); - public static native long CResult_NoneLightningErrorZ_err(long e); - // bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o); - public static native boolean CResult_NoneLightningErrorZ_is_ok(long o); - // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); - public static native void CResult_NoneLightningErrorZ_free(long _res); - // uintptr_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg); - public static native long CResult_NoneLightningErrorZ_clone_ptr(long arg); - // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); - public static native long CResult_NoneLightningErrorZ_clone(long orig); // uintptr_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg); public static native long C2Tuple_PublicKeyTypeZ_clone_ptr(long arg); // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig); @@ -3104,32 +3330,6 @@ public class bindings { public static native void C2Tuple_PublicKeyTypeZ_free(long _res); // void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res); public static native void CVec_C2Tuple_PublicKeyTypeZZ_free(long[] _res); - // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); - public static native long CResult_boolLightningErrorZ_ok(boolean o); - // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); - public static native long CResult_boolLightningErrorZ_err(long e); - // bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o); - public static native boolean CResult_boolLightningErrorZ_is_ok(long o); - // void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); - public static native void CResult_boolLightningErrorZ_free(long _res); - // uintptr_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg); - public static native long CResult_boolLightningErrorZ_clone_ptr(long arg); - // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig); - public static native long CResult_boolLightningErrorZ_clone(long orig); - // uintptr_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg); - public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(long arg); - // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig); - public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(long orig); - // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); - public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(long a, long b, long c); - // void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); - public static native void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(long _res); - // void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); - public static native void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(long[] _res); - // void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res); - public static native void CVec_NodeAnnouncementZ_free(long[] _res); - // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); - public static native void CVec_PublicKeyZ_free(byte[][] _res); // struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o); public static native long COption_NetAddressZ_some(long o); // struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void); @@ -3176,120 +3376,14 @@ public class bindings { public static native long CResult_boolPeerHandleErrorZ_clone_ptr(long arg); // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig); public static native long CResult_boolPeerHandleErrorZ_clone(long orig); - // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o); - public static native long CResult_NodeIdDecodeErrorZ_ok(long o); - // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_NodeIdDecodeErrorZ_err(long e); - // bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_NodeIdDecodeErrorZ_is_ok(long o); - // void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res); - public static native void CResult_NodeIdDecodeErrorZ_free(long _res); - // uintptr_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_NodeIdDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_NodeIdDecodeErrorZ_clone(long orig); - // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o); - public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_ok(long o); - // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_err(long e); - // bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(long o); - // void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res); - public static native void CResult_COption_NetworkUpdateZDecodeErrorZ_free(long _res); - // uintptr_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_COption_NetworkUpdateZDecodeErrorZ_clone(long orig); - // struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o); - public static native long COption_AccessZ_some(long o); - // struct LDKCOption_AccessZ COption_AccessZ_none(void); - public static native long COption_AccessZ_none(); - // void COption_AccessZ_free(struct LDKCOption_AccessZ _res); - public static native void COption_AccessZ_free(long _res); - // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o); - public static native long CResult_ChannelUpdateInfoDecodeErrorZ_ok(long o); - // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_ChannelUpdateInfoDecodeErrorZ_err(long e); - // bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(long o); - // void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res); - public static native void CResult_ChannelUpdateInfoDecodeErrorZ_free(long _res); - // uintptr_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_ChannelUpdateInfoDecodeErrorZ_clone(long orig); - // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o); - public static native long CResult_ChannelInfoDecodeErrorZ_ok(long o); - // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_ChannelInfoDecodeErrorZ_err(long e); - // bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_ChannelInfoDecodeErrorZ_is_ok(long o); - // void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res); - public static native void CResult_ChannelInfoDecodeErrorZ_free(long _res); - // uintptr_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_ChannelInfoDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_ChannelInfoDecodeErrorZ_clone(long orig); - // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); - public static native long CResult_RoutingFeesDecodeErrorZ_ok(long o); - // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_RoutingFeesDecodeErrorZ_err(long e); - // bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_RoutingFeesDecodeErrorZ_is_ok(long o); - // void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); - public static native void CResult_RoutingFeesDecodeErrorZ_free(long _res); - // uintptr_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_RoutingFeesDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_RoutingFeesDecodeErrorZ_clone(long orig); - // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); - public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_ok(long o); - // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_err(long e); - // bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(long o); - // void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); - public static native void CResult_NodeAnnouncementInfoDecodeErrorZ_free(long _res); - // uintptr_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_NodeAnnouncementInfoDecodeErrorZ_clone(long orig); - // void CVec_u64Z_free(struct LDKCVec_u64Z _res); - public static native void CVec_u64Z_free(long[] _res); - // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); - public static native long CResult_NodeInfoDecodeErrorZ_ok(long o); - // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_NodeInfoDecodeErrorZ_err(long e); - // bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_NodeInfoDecodeErrorZ_is_ok(long o); - // void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); - public static native void CResult_NodeInfoDecodeErrorZ_free(long _res); - // uintptr_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_NodeInfoDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_NodeInfoDecodeErrorZ_clone(long orig); - // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); - public static native long CResult_NetworkGraphDecodeErrorZ_ok(long o); - // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_NetworkGraphDecodeErrorZ_err(long e); - // bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_NetworkGraphDecodeErrorZ_is_ok(long o); - // void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); - public static native void CResult_NetworkGraphDecodeErrorZ_free(long _res); - // uintptr_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_NetworkGraphDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_NetworkGraphDecodeErrorZ_clone(long orig); - // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o); - public static native long COption_CVec_NetAddressZZ_some(long[] o); - // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void); - public static native long COption_CVec_NetAddressZZ_none(); - // void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res); - public static native void COption_CVec_NetAddressZZ_free(long _res); - // uintptr_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg); - public static native long COption_CVec_NetAddressZZ_clone_ptr(long arg); - // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig); - public static native long COption_CVec_NetAddressZZ_clone(long orig); + // struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o); + public static native long CResult_u32GraphSyncErrorZ_ok(int o); + // struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e); + public static native long CResult_u32GraphSyncErrorZ_err(long e); + // bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o); + public static native boolean CResult_u32GraphSyncErrorZ_is_ok(long o); + // void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res); + public static native void CResult_u32GraphSyncErrorZ_free(long _res); // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o); public static native long CResult_NetAddressDecodeErrorZ_ok(long o); // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e); @@ -3406,18 +3500,18 @@ public class bindings { public static native long CResult_FundingSignedDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_FundingSignedDecodeErrorZ_clone(long orig); - // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o); - public static native long CResult_FundingLockedDecodeErrorZ_ok(long o); - // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_FundingLockedDecodeErrorZ_err(long e); - // bool CResult_FundingLockedDecodeErrorZ_is_ok(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_FundingLockedDecodeErrorZ_is_ok(long o); - // void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res); - public static native void CResult_FundingLockedDecodeErrorZ_free(long _res); - // uintptr_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_FundingLockedDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_FundingLockedDecodeErrorZ_clone(long orig); + // struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o); + public static native long CResult_ChannelReadyDecodeErrorZ_ok(long o); + // struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChannelReadyDecodeErrorZ_err(long e); + // bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelReadyDecodeErrorZ_is_ok(long o); + // void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res); + public static native void CResult_ChannelReadyDecodeErrorZ_free(long _res); + // uintptr_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelReadyDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_ChannelReadyDecodeErrorZ_clone(long orig); // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o); public static native long CResult_InitDecodeErrorZ_ok(long o); // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e); @@ -3746,6 +3840,10 @@ public class bindings { public static native long PaymentPurpose_invoice_payment(byte[] payment_preimage, byte[] payment_secret); // struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a); public static native long PaymentPurpose_spontaneous_payment(byte[] a); + // struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj); + public static native byte[] PaymentPurpose_write(long obj); + // struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser); + public static native long PaymentPurpose_read(byte[] ser); // void ClosureReason_free(struct LDKClosureReason this_ptr); public static native void ClosureReason_free(long this_ptr); // uintptr_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg); @@ -3778,28 +3876,30 @@ public class bindings { public static native long Event_clone_ptr(long arg); // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); public static native long Event_clone(long orig); - // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id); - public static native long Event_funding_generation_ready(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id); - // struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose); - public static native long Event_payment_received(byte[] payment_hash, long amt, long purpose); + // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id); + public static native long Event_funding_generation_ready(byte[] temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, long user_channel_id); + // struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose); + public static native long Event_payment_received(byte[] payment_hash, long amount_msat, long purpose); + // struct LDKEvent Event_payment_claimed(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose); + public static native long Event_payment_claimed(byte[] payment_hash, long amount_msat, long purpose); // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat); public static native long Event_payment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, long fee_paid_msat); - // struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry); - public static native long Event_payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, long network_update, boolean all_paths_failed, long[] path, long short_channel_id, long retry); // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash); public static native long Event_payment_failed(byte[] payment_id, byte[] payment_hash); + // struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path); + public static native long Event_payment_path_successful(byte[] payment_id, byte[] payment_hash, long[] path); + // struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry); + public static native long Event_payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, long network_update, boolean all_paths_failed, long[] path, long short_channel_id, long retry); // struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable); public static native long Event_pending_htlcs_forwardable(long time_forwardable); // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs); public static native long Event_spendable_outputs(long[] outputs); - // struct LDKEvent Event_payment_forwarded(struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx); - public static native long Event_payment_forwarded(long fee_earned_msat, boolean claim_from_onchain_tx); + // struct LDKEvent Event_payment_forwarded(struct LDKThirtyTwoBytes prev_channel_id, struct LDKThirtyTwoBytes next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx); + public static native long Event_payment_forwarded(byte[] prev_channel_id, byte[] next_channel_id, long fee_earned_msat, boolean claim_from_onchain_tx); // struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason); public static native long Event_channel_closed(byte[] channel_id, long user_channel_id, long reason); // struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction); public static native long Event_discard_funding(byte[] channel_id, byte[] transaction); - // struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path); - public static native long Event_payment_path_successful(byte[] payment_id, byte[] payment_hash, long[] path); // struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type); public static native long Event_open_channel_request(byte[] temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, long channel_type); // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); @@ -3820,8 +3920,8 @@ public class bindings { public static native long MessageSendEvent_send_funding_created(byte[] node_id, long msg); // struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg); public static native long MessageSendEvent_send_funding_signed(byte[] node_id, long msg); - // struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg); - public static native long MessageSendEvent_send_funding_locked(byte[] node_id, long msg); + // struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg); + public static native long MessageSendEvent_send_channel_ready(byte[] node_id, long msg); // struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg); public static native long MessageSendEvent_send_announcement_signatures(byte[] node_id, long msg); // struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates); @@ -3876,6 +3976,14 @@ public class bindings { public static native long APIError_monitor_update_failed(); // struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script); public static native long APIError_incompatible_shutdown_script(long script); + // void BigSize_free(struct LDKBigSize this_obj); + public static native void BigSize_free(long this_obj); + // uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr); + public static native long BigSize_get_a(long this_ptr); + // void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val); + public static native void BigSize_set_a(long this_ptr, long val); + // MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg); + public static native long BigSize_new(long a_arg); // struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]); public static native long sign(byte[] msg, byte[] sk); // struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig); @@ -3884,6 +3992,8 @@ public class bindings { public static native boolean verify(byte[] msg, String sig, byte[] pk); // struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature); public static native byte[] construct_invoice_preimage(byte[] hrp_bytes, byte[] data_without_signature); + // void Persister_free(struct LDKPersister this_ptr); + public static native void Persister_free(long this_ptr); // enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig); public static native Level Level_clone(long orig); // enum LDKLevel Level_gossip(void); @@ -3946,12 +4056,16 @@ public class bindings { public static native long ChannelHandshakeConfig_get_our_htlc_minimum_msat(long this_ptr); // void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelHandshakeConfig_set_our_htlc_minimum_msat(long this_ptr, long val); + // uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); + public static native byte ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(long this_ptr); + // void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val); + public static native void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(long this_ptr, byte val); // bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); public static native boolean ChannelHandshakeConfig_get_negotiate_scid_privacy(long this_ptr); // void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val); public static native void ChannelHandshakeConfig_set_negotiate_scid_privacy(long this_ptr, boolean val); - // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, bool negotiate_scid_privacy_arg); - public static native long ChannelHandshakeConfig_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, boolean negotiate_scid_privacy_arg); + // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg); + public static native long ChannelHandshakeConfig_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, boolean negotiate_scid_privacy_arg); // uintptr_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg); public static native long ChannelHandshakeConfig_clone_ptr(long arg); // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); @@ -3964,6 +4078,10 @@ public class bindings { public static native long ChannelHandshakeLimits_get_min_funding_satoshis(long this_ptr); // void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); public static native void ChannelHandshakeLimits_set_min_funding_satoshis(long this_ptr, long val); + // uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); + public static native long ChannelHandshakeLimits_get_max_funding_satoshis(long this_ptr); + // void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); + public static native void ChannelHandshakeLimits_set_max_funding_satoshis(long this_ptr, long val); // uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native long ChannelHandshakeLimits_get_max_htlc_minimum_msat(long this_ptr); // void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); @@ -3984,6 +4102,10 @@ public class bindings { public static native int ChannelHandshakeLimits_get_max_minimum_depth(long this_ptr); // void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val); public static native void ChannelHandshakeLimits_set_max_minimum_depth(long this_ptr, int val); + // bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); + public static native boolean ChannelHandshakeLimits_get_trust_own_funding_0conf(long this_ptr); + // void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val); + public static native void ChannelHandshakeLimits_set_trust_own_funding_0conf(long this_ptr, boolean val); // bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); public static native boolean ChannelHandshakeLimits_get_force_announced_channel_preference(long this_ptr); // void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val); @@ -3992,8 +4114,8 @@ public class bindings { public static native short ChannelHandshakeLimits_get_their_to_self_delay(long this_ptr); // void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val); public static native void ChannelHandshakeLimits_set_their_to_self_delay(long this_ptr, short val); - // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg); - public static native long ChannelHandshakeLimits_new(long min_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, int max_minimum_depth_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg); + // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint32_t max_minimum_depth_arg, bool trust_own_funding_0conf_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg); + public static native long ChannelHandshakeLimits_new(long min_funding_satoshis_arg, long max_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, int max_minimum_depth_arg, boolean trust_own_funding_0conf_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg); // uintptr_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg); public static native long ChannelHandshakeLimits_clone_ptr(long arg); // struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig); @@ -4538,8 +4660,16 @@ public class bindings { public static native long ChannelCounterparty_get_forwarding_info(long this_ptr); // void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val); public static native void ChannelCounterparty_set_forwarding_info(long this_ptr, long val); - // MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg); - public static native long ChannelCounterparty_new(byte[] node_id_arg, long features_arg, long unspendable_punishment_reserve_arg, long forwarding_info_arg); + // struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); + public static native long ChannelCounterparty_get_outbound_htlc_minimum_msat(long this_ptr); + // void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void ChannelCounterparty_set_outbound_htlc_minimum_msat(long this_ptr, long val); + // struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); + public static native long ChannelCounterparty_get_outbound_htlc_maximum_msat(long this_ptr); + // void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void ChannelCounterparty_set_outbound_htlc_maximum_msat(long this_ptr, long val); + // MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg); + public static native long ChannelCounterparty_new(byte[] node_id_arg, long features_arg, long unspendable_punishment_reserve_arg, long forwarding_info_arg, long outbound_htlc_minimum_msat_arg, long outbound_htlc_maximum_msat_arg); // uintptr_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg); public static native long ChannelCounterparty_clone_ptr(long arg); // struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig); @@ -4566,6 +4696,10 @@ public class bindings { public static native long ChannelDetails_get_short_channel_id(long this_ptr); // void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); public static native void ChannelDetails_set_short_channel_id(long this_ptr, long val); + // struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + public static native long ChannelDetails_get_outbound_scid_alias(long this_ptr); + // void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void ChannelDetails_set_outbound_scid_alias(long this_ptr, long val); // struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_inbound_scid_alias(long this_ptr); // void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); @@ -4590,6 +4724,10 @@ public class bindings { 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); public static native void ChannelDetails_set_outbound_capacity_msat(long this_ptr, long val); + // uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + public static native long ChannelDetails_get_next_outbound_htlc_limit_msat(long this_ptr); + // void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); + public static native void ChannelDetails_set_next_outbound_htlc_limit_msat(long this_ptr, long val); // uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_inbound_capacity_msat(long this_ptr); // void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); @@ -4606,10 +4744,10 @@ public class bindings { public static native boolean ChannelDetails_get_is_outbound(long this_ptr); // void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); public static native void ChannelDetails_set_is_outbound(long this_ptr, boolean val); - // bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native boolean ChannelDetails_get_is_funding_locked(long this_ptr); - // void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); - public static native void ChannelDetails_set_is_funding_locked(long this_ptr, boolean val); + // bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + public static native boolean ChannelDetails_get_is_channel_ready(long this_ptr); + // void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); + public static native void ChannelDetails_set_is_channel_ready(long this_ptr, boolean val); // bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native boolean ChannelDetails_get_is_usable(long this_ptr); // void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); @@ -4618,14 +4756,24 @@ public class bindings { public static native boolean ChannelDetails_get_is_public(long this_ptr); // void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); public static native void ChannelDetails_set_is_public(long this_ptr, boolean val); - // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes 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 inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg); - public static native long ChannelDetails_new(byte[] channel_id_arg, long counterparty_arg, long funding_txo_arg, long channel_type_arg, long short_channel_id_arg, long inbound_scid_alias_arg, long channel_value_satoshis_arg, long unspendable_punishment_reserve_arg, long user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, long confirmations_required_arg, long force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg); + // struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + public static native long ChannelDetails_get_inbound_htlc_minimum_msat(long this_ptr); + // void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void ChannelDetails_set_inbound_htlc_minimum_msat(long this_ptr, long val); + // struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + public static native long ChannelDetails_get_inbound_htlc_maximum_msat(long this_ptr); + // void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void ChannelDetails_set_inbound_htlc_maximum_msat(long this_ptr, long val); + // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes 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, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg); + public static native long ChannelDetails_new(byte[] 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, long user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long inbound_capacity_msat_arg, long confirmations_required_arg, long force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, boolean is_usable_arg, boolean is_public_arg, long inbound_htlc_minimum_msat_arg, long inbound_htlc_maximum_msat_arg); // uintptr_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); public static native long ChannelDetails_clone(long orig); // MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg); public static native long ChannelDetails_get_inbound_payment_scid(long this_arg); + // MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg); + public static native long ChannelDetails_get_outbound_payment_scid(long this_arg); // void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); public static native void PaymentSendFailure_free(long this_ptr); // uintptr_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg); @@ -4670,12 +4818,12 @@ public class bindings { public static native long[] ChannelManager_list_channels(long this_arg); // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long[] ChannelManager_list_usable_channels(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]); - public static native long ChannelManager_close_channel(long this_arg, byte[] channel_id); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_target_feerate(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], uint32_t target_feerate_sats_per_1000_weight); - public static native long ChannelManager_close_channel_with_target_feerate(long this_arg, byte[] channel_id, int target_feerate_sats_per_1000_weight); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]); - public static native long ChannelManager_force_close_channel(long this_arg, byte[] channel_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id); + public static native long ChannelManager_close_channel(long this_arg, byte[] channel_id, byte[] counterparty_node_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_target_feerate(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, uint32_t target_feerate_sats_per_1000_weight); + public static native long ChannelManager_close_channel_with_target_feerate(long this_arg, byte[] channel_id, byte[] counterparty_node_id, int target_feerate_sats_per_1000_weight); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id); + public static native long ChannelManager_force_close_channel(long this_arg, byte[] channel_id, byte[] counterparty_node_id); // void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native void ChannelManager_force_close_all_channels(long this_arg); // MUST_USE_RES struct LDKCResult_PaymentIdPaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret); @@ -4686,22 +4834,24 @@ public class bindings { public static native void ChannelManager_abandon_payment(long this_arg, byte[] payment_id); // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage); public static native long ChannelManager_send_spontaneous_payment(long this_arg, long route, byte[] payment_preimage); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKTransaction funding_transaction); - public static native long ChannelManager_funding_transaction_generated(long this_arg, byte[] temporary_channel_id, byte[] funding_transaction); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction); + public static native long ChannelManager_funding_transaction_generated(long this_arg, byte[] temporary_channel_id, byte[] counterparty_node_id, byte[] funding_transaction); // void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses); public static native void ChannelManager_broadcast_node_announcement(long this_arg, byte[] rgb, byte[] alias, long[] addresses); // void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native void ChannelManager_process_pending_htlc_forwards(long this_arg); // void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native void ChannelManager_timer_tick_occurred(long this_arg); - // MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]); - public static native boolean ChannelManager_fail_htlc_backwards(long this_arg, byte[] payment_hash); - // MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage); - public static native boolean ChannelManager_claim_funds(long this_arg, byte[] payment_preimage); + // void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]); + public static native void ChannelManager_fail_htlc_backwards(long this_arg, byte[] payment_hash); + // void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage); + public static native void ChannelManager_claim_funds(long this_arg, byte[] payment_preimage); // MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native byte[] ChannelManager_get_our_node_id(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], uint64_t user_channel_id); - public static native long ChannelManager_accept_inbound_channel(long this_arg, byte[] temporary_channel_id, long user_channel_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, uint64_t user_channel_id); + public static native long ChannelManager_accept_inbound_channel(long this_arg, byte[] temporary_channel_id, byte[] counterparty_node_id, long 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 uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, uint64_t user_channel_id); + public static native long ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(long this_arg, byte[] temporary_channel_id, byte[] counterparty_node_id, long user_channel_id); // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); public static native long ChannelManager_create_inbound_payment(long this_arg, long min_value_msat, int invoice_expiry_delta_secs); // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ChannelManager_create_inbound_payment_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); @@ -4780,6 +4930,14 @@ public class bindings { public static native long ChannelManagerReadArgs_new(long keys_manager, long fee_estimator, long chain_monitor, long tx_broadcaster, long logger, long default_config, long[] channel_monitors); // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg); public static native long C2Tuple_BlockHashChannelManagerZ_read(byte[] ser, long arg); + // 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]); + public static native long ExpandedKey_new(byte[] key_material); + // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKKeysInterface *NONNULL_PTR keys_manager, uint64_t current_time); + public static native long create(long keys, long min_value_msat, int invoice_expiry_delta_secs, long keys_manager, long current_time); + // struct LDKCResult_PaymentSecretNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time); + public static native long create_from_hash(long keys, long min_value_msat, byte[] payment_hash, int invoice_expiry_delta_secs, long current_time); // void DecodeError_free(struct LDKDecodeError this_obj); public static native void DecodeError_free(long this_obj); // uintptr_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg); @@ -5050,26 +5208,26 @@ public class bindings { public static native long FundingSigned_clone_ptr(long arg); // struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); public static native long FundingSigned_clone(long orig); - // void FundingLocked_free(struct LDKFundingLocked this_obj); - public static native void FundingLocked_free(long this_obj); - // const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32]; - public static native byte[] FundingLocked_get_channel_id(long this_ptr); - // void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void FundingLocked_set_channel_id(long this_ptr, byte[] val); - // struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr); - public static native byte[] FundingLocked_get_next_per_commitment_point(long this_ptr); - // void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void FundingLocked_set_next_per_commitment_point(long this_ptr, byte[] val); - // struct LDKCOption_u64Z FundingLocked_get_short_channel_id_alias(const struct LDKFundingLocked *NONNULL_PTR this_ptr); - public static native long FundingLocked_get_short_channel_id_alias(long this_ptr); - // void FundingLocked_set_short_channel_id_alias(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - public static native void FundingLocked_set_short_channel_id_alias(long this_ptr, long val); - // MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg); - public static native long FundingLocked_new(byte[] channel_id_arg, byte[] next_per_commitment_point_arg, long short_channel_id_alias_arg); - // uintptr_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg); - public static native long FundingLocked_clone_ptr(long arg); - // struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig); - public static native long FundingLocked_clone(long orig); + // void ChannelReady_free(struct LDKChannelReady this_obj); + public static native void ChannelReady_free(long this_obj); + // const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32]; + public static native byte[] ChannelReady_get_channel_id(long this_ptr); + // void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + public static native void ChannelReady_set_channel_id(long this_ptr, byte[] val); + // struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr); + public static native byte[] ChannelReady_get_next_per_commitment_point(long this_ptr); + // void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val); + public static native void ChannelReady_set_next_per_commitment_point(long this_ptr, byte[] val); + // struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr); + public static native long ChannelReady_get_short_channel_id_alias(long this_ptr); + // void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + public static native void ChannelReady_set_short_channel_id_alias(long this_ptr, long val); + // MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg); + public static native long ChannelReady_new(byte[] channel_id_arg, byte[] next_per_commitment_point_arg, long short_channel_id_alias_arg); + // uintptr_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg); + public static native long ChannelReady_clone_ptr(long arg); + // struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig); + public static native long ChannelReady_clone(long orig); // void Shutdown_free(struct LDKShutdown this_obj); public static native void Shutdown_free(long this_obj); // const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32]; @@ -5474,6 +5632,8 @@ public class bindings { public static native int UnsignedChannelUpdate_get_fee_proportional_millionths(long this_ptr); // void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); public static native void UnsignedChannelUpdate_set_fee_proportional_millionths(long this_ptr, int val); + // void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + public static native void UnsignedChannelUpdate_set_excess_data(long this_ptr, byte[] val); // uintptr_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg); public static native long UnsignedChannelUpdate_clone_ptr(long arg); // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); @@ -5692,10 +5852,10 @@ public class bindings { public static native byte[] FundingSigned_write(long obj); // struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser); public static native long FundingSigned_read(byte[] ser); - // struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj); - public static native byte[] FundingLocked_write(long obj); - // struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser); - public static native long FundingLocked_read(byte[] ser); + // struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj); + public static native byte[] ChannelReady_write(long obj); + // struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser); + public static native long ChannelReady_read(byte[] ser); // struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj); public static native byte[] Init_write(long obj); // struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser); @@ -6288,6 +6448,260 @@ public class bindings { public static native byte[] ChannelTypeFeatures_write(long obj); // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser); public static native long ChannelTypeFeatures_read(byte[] ser); + // void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_data_loss_protect_optional(long this_arg); + // void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_data_loss_protect_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_data_loss_protect(long this_arg); + // void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_data_loss_protect_optional(long this_arg); + // void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_data_loss_protect_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_data_loss_protect(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_data_loss_protect(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_data_loss_protect(long this_arg); + // void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_initial_routing_sync_optional(long this_arg); + // void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_initial_routing_sync_required(long this_arg); + // MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_initial_routing_sync(long this_arg); + // void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_upfront_shutdown_script_optional(long this_arg); + // void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_upfront_shutdown_script_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_upfront_shutdown_script(long this_arg); + // void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_upfront_shutdown_script_optional(long this_arg); + // void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_upfront_shutdown_script_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_upfront_shutdown_script(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_upfront_shutdown_script(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_upfront_shutdown_script(long this_arg); + // void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_gossip_queries_optional(long this_arg); + // void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_gossip_queries_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_gossip_queries(long this_arg); + // void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_gossip_queries_optional(long this_arg); + // void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_gossip_queries_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_gossip_queries(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_gossip_queries(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_gossip_queries(long this_arg); + // void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_variable_length_onion_optional(long this_arg); + // void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_variable_length_onion_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_variable_length_onion(long this_arg); + // void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_variable_length_onion_optional(long this_arg); + // void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_variable_length_onion_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_variable_length_onion(long this_arg); + // void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native void InvoiceFeatures_set_variable_length_onion_optional(long this_arg); + // void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native void InvoiceFeatures_set_variable_length_onion_required(long this_arg); + // MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceFeatures_supports_variable_length_onion(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_variable_length_onion(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_variable_length_onion(long this_arg); + // MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceFeatures_requires_variable_length_onion(long this_arg); + // void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_static_remote_key_optional(long this_arg); + // void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_static_remote_key_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_static_remote_key(long this_arg); + // void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_static_remote_key_optional(long this_arg); + // void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_static_remote_key_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_static_remote_key(long this_arg); + // void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_static_remote_key_optional(long this_arg); + // void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_static_remote_key_required(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_static_remote_key(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_static_remote_key(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_static_remote_key(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_static_remote_key(long this_arg); + // void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_payment_secret_optional(long this_arg); + // void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_payment_secret_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_payment_secret(long this_arg); + // void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_payment_secret_optional(long this_arg); + // void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_payment_secret_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_payment_secret(long this_arg); + // void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native void InvoiceFeatures_set_payment_secret_optional(long this_arg); + // void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native void InvoiceFeatures_set_payment_secret_required(long this_arg); + // MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceFeatures_supports_payment_secret(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_payment_secret(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_payment_secret(long this_arg); + // MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceFeatures_requires_payment_secret(long this_arg); + // void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_basic_mpp_optional(long this_arg); + // void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_basic_mpp_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_basic_mpp(long this_arg); + // void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_basic_mpp_optional(long this_arg); + // void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_basic_mpp_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_basic_mpp(long this_arg); + // void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native void InvoiceFeatures_set_basic_mpp_optional(long this_arg); + // void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native void InvoiceFeatures_set_basic_mpp_required(long this_arg); + // MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceFeatures_supports_basic_mpp(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_basic_mpp(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_basic_mpp(long this_arg); + // MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceFeatures_requires_basic_mpp(long this_arg); + // void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_wumbo_optional(long this_arg); + // void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_wumbo_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_wumbo(long this_arg); + // void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_wumbo_optional(long this_arg); + // void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_wumbo_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_wumbo(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_wumbo(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_wumbo(long this_arg); + // void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_shutdown_any_segwit_optional(long this_arg); + // void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_shutdown_any_segwit_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_shutdown_anysegwit(long this_arg); + // void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_shutdown_any_segwit_optional(long this_arg); + // void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_shutdown_any_segwit_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_shutdown_anysegwit(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_shutdown_anysegwit(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_shutdown_anysegwit(long this_arg); + // void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_channel_type_optional(long this_arg); + // void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_channel_type_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_channel_type(long this_arg); + // void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_channel_type_optional(long this_arg); + // void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_channel_type_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_channel_type(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_channel_type(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_channel_type(long this_arg); + // void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_scid_privacy_optional(long this_arg); + // void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_scid_privacy_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_scid_privacy(long this_arg); + // void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_scid_privacy_optional(long this_arg); + // void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_scid_privacy_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_scid_privacy(long this_arg); + // void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_scid_privacy_optional(long this_arg); + // void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_scid_privacy_required(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_scid_privacy(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_scid_privacy(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_scid_privacy(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_scid_privacy(long this_arg); + // void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_zero_conf_optional(long this_arg); + // void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native void InitFeatures_set_zero_conf_required(long this_arg); + // MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_supports_zero_conf(long this_arg); + // void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_zero_conf_optional(long this_arg); + // void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_zero_conf_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_zero_conf(long this_arg); + // void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_zero_conf_optional(long this_arg); + // void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native void ChannelTypeFeatures_set_zero_conf_required(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_supports_zero_conf(long this_arg); + // MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg); + public static native boolean InitFeatures_requires_zero_conf(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_zero_conf(long this_arg); + // MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); + public static native boolean ChannelTypeFeatures_requires_zero_conf(long this_arg); + // void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_keysend_optional(long this_arg); + // void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native void NodeFeatures_set_keysend_required(long this_arg); + // MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_supports_keysend(long this_arg); + // MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + public static native boolean NodeFeatures_requires_keysend(long this_arg); // void ShutdownScript_free(struct LDKShutdownScript this_obj); public static native void ShutdownScript_free(long this_obj); // uintptr_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg); @@ -6314,7 +6728,7 @@ public class bindings { public static native long ShutdownScript_new_p2wpkh(byte[] pubkey_hash); // MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]); public static native long ShutdownScript_new_p2wsh(byte[] script_hash); - // MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(uint8_t version, struct LDKu8slice program); + // MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program); public static native long ShutdownScript_new_witness_program(byte version, byte[] program); // MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg); public static native byte[] ShutdownScript_into_inner(long this_arg); @@ -6348,10 +6762,6 @@ public class bindings { public static native long NodeId_read(byte[] ser); // void NetworkGraph_free(struct LDKNetworkGraph this_obj); public static native void NetworkGraph_free(long this_obj); - // uintptr_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg); - public static native long NetworkGraph_clone_ptr(long arg); - // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig); - public static native long NetworkGraph_clone(long orig); // void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj); public static native void ReadOnlyNetworkGraph_free(long this_obj); // void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr); @@ -6362,26 +6772,26 @@ public class bindings { public static native long NetworkUpdate_clone(long orig); // struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg); public static native long NetworkUpdate_channel_update_message(long msg); - // struct LDKNetworkUpdate NetworkUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent); - public static native long NetworkUpdate_channel_closed(long short_channel_id, boolean is_permanent); + // struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent); + public static native long NetworkUpdate_channel_failure(long short_channel_id, boolean is_permanent); // struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent); public static native long NetworkUpdate_node_failure(byte[] node_id, boolean is_permanent); // struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj); public static native byte[] NetworkUpdate_write(long obj); // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser); public static native long NetworkUpdate_read(byte[] ser); - // struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); - public static native long NetGraphMsgHandler_as_EventHandler(long this_arg); - // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj); - public static native void NetGraphMsgHandler_free(long this_obj); - // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger); - public static native long NetGraphMsgHandler_new(long network_graph, long chain_access, long logger); - // void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access); - public static native void NetGraphMsgHandler_add_chain_access(long this_arg, long chain_access); - // struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); - public static native long NetGraphMsgHandler_as_RoutingMessageHandler(long this_arg); - // struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); - public static native long NetGraphMsgHandler_as_MessageSendEventsProvider(long this_arg); + // void P2PGossipSync_free(struct LDKP2PGossipSync this_obj); + public static native void P2PGossipSync_free(long this_obj); + // MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger); + public static native long P2PGossipSync_new(long network_graph, long chain_access, long logger); + // void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access); + public static native void P2PGossipSync_add_chain_access(long this_arg, long chain_access); + // struct LDKEventHandler NetworkGraph_as_EventHandler(const struct LDKNetworkGraph *NONNULL_PTR this_arg); + public static native long NetworkGraph_as_EventHandler(long this_arg); + // struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg); + public static native long P2PGossipSync_as_RoutingMessageHandler(long this_arg); + // struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg); + public static native long P2PGossipSync_as_MessageSendEventsProvider(long this_arg); // void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj); public static native void ChannelUpdateInfo_free(long this_obj); // uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr); @@ -6456,6 +6866,8 @@ public class bindings { public static native long ChannelInfo_clone_ptr(long arg); // struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig); public static native long ChannelInfo_clone(long orig); + // MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags); + public static native long ChannelInfo_get_directional_info(long this_arg, byte channel_flags); // struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); public static native byte[] ChannelInfo_write(long obj); // struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser); @@ -6470,6 +6882,8 @@ public class bindings { public static native long DirectedChannelInfo_channel(long this_arg); // MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg); public static native long DirectedChannelInfo_direction(long this_arg); + // MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg); + public static native long DirectedChannelInfo_htlc_maximum_msat(long this_arg); // MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg); public static native long DirectedChannelInfo_effective_capacity(long this_arg); // void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr); @@ -6572,12 +6986,16 @@ public class bindings { public static native long NodeInfo_read(byte[] ser); // struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj); public static native byte[] NetworkGraph_write(long obj); - // struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser); - public static native long NetworkGraph_read(byte[] ser); - // MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash); - public static native long NetworkGraph_new(byte[] genesis_hash); + // struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg); + public static native long NetworkGraph_read(byte[] ser, long arg); + // MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger); + public static native long NetworkGraph_new(byte[] genesis_hash, long logger); // MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg); public static native long NetworkGraph_read_only(long this_arg); + // MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg); + public static native long NetworkGraph_get_last_rapid_gossip_sync_timestamp(long this_arg); + // void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp); + public static native void NetworkGraph_set_last_rapid_gossip_sync_timestamp(long this_arg, int last_rapid_gossip_sync_timestamp); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg); public static native long NetworkGraph_update_node_from_announcement(long this_arg, long msg); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg); @@ -6586,10 +7004,12 @@ public class bindings { public static native long NetworkGraph_update_channel_from_announcement(long this_arg, long msg, long chain_access); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access); public static native long NetworkGraph_update_channel_from_unsigned_announcement(long this_arg, long msg, long chain_access); - // void NetworkGraph_close_channel_from_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent); - public static native void NetworkGraph_close_channel_from_update(long this_arg, long short_channel_id, boolean is_permanent); - // void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent); - public static native void NetworkGraph_fail_node(long this_arg, byte[] _node_id, boolean is_permanent); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_add_channel_from_partial_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t timestamp, struct LDKChannelFeatures features, struct LDKPublicKey node_id_1, struct LDKPublicKey node_id_2); + public static native long NetworkGraph_add_channel_from_partial_announcement(long this_arg, long short_channel_id, long timestamp, long features, byte[] node_id_1, byte[] node_id_2); + // void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent); + public static native void NetworkGraph_channel_failed(long this_arg, long short_channel_id, boolean is_permanent); + // void NetworkGraph_node_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent); + public static native void NetworkGraph_node_failed(long this_arg, byte[] _node_id, boolean is_permanent); // void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg); public static native void NetworkGraph_remove_stale_channels(long this_arg); // void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix); @@ -6792,16 +7212,40 @@ public class bindings { public static native byte[] RouteHintHop_write(long obj); // struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser); public static native long RouteHintHop_read(byte[] ser); - // struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer, const uint8_t (*random_seed_bytes)[32]); - public static native long find_route(byte[] our_node_pubkey, long route_params, long network, long[] first_hops, long logger, long scorer, byte[] random_seed_bytes); + // struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer, const uint8_t (*random_seed_bytes)[32]); + public static native long find_route(byte[] our_node_pubkey, long route_params, long network_graph, long[] first_hops, long logger, long scorer, byte[] random_seed_bytes); + // struct LDKCResult_RouteLightningErrorZ build_route_from_hops(struct LDKPublicKey our_node_pubkey, struct LDKCVec_PublicKeyZ hops, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, const uint8_t (*random_seed_bytes)[32]); + public static native long build_route_from_hops(byte[] our_node_pubkey, byte[][] hops, long route_params, long network_graph, long logger, byte[] random_seed_bytes); // void Score_free(struct LDKScore this_ptr); public static native void Score_free(long this_ptr); // void LockableScore_free(struct LDKLockableScore this_ptr); public static native void LockableScore_free(long this_ptr); // void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj); public static native void MultiThreadedLockableScore_free(long this_obj); + // struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj); + public static native byte[] MultiThreadedLockableScore_write(long obj); // MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score); public static native long MultiThreadedLockableScore_new(long score); + // void ChannelUsage_free(struct LDKChannelUsage this_obj); + public static native void ChannelUsage_free(long this_obj); + // uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr); + public static native long ChannelUsage_get_amount_msat(long this_ptr); + // void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val); + public static native void ChannelUsage_set_amount_msat(long this_ptr, long val); + // uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr); + public static native long ChannelUsage_get_inflight_htlc_msat(long this_ptr); + // void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val); + public static native void ChannelUsage_set_inflight_htlc_msat(long this_ptr, long val); + // struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr); + public static native long ChannelUsage_get_effective_capacity(long this_ptr); + // void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val); + public static native void ChannelUsage_set_effective_capacity(long this_ptr, long val); + // MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg); + public static native long ChannelUsage_new(long amount_msat_arg, long inflight_htlc_msat_arg, long effective_capacity_arg); + // uintptr_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg); + public static native long ChannelUsage_clone_ptr(long arg); + // struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig); + public static native long ChannelUsage_clone(long orig); // void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj); public static native void FixedPenaltyScorer_free(long this_obj); // uintptr_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg); @@ -6816,52 +7260,6 @@ public class bindings { public static native byte[] FixedPenaltyScorer_write(long obj); // struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg); public static native long FixedPenaltyScorer_read(byte[] ser, long arg); - // void Scorer_free(struct LDKScorer this_obj); - public static native void Scorer_free(long this_obj); - // void ScoringParameters_free(struct LDKScoringParameters this_obj); - public static native void ScoringParameters_free(long this_obj); - // uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr); - public static native long ScoringParameters_get_base_penalty_msat(long this_ptr); - // void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - public static native void ScoringParameters_set_base_penalty_msat(long this_ptr, long val); - // uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr); - public static native long ScoringParameters_get_failure_penalty_msat(long this_ptr); - // void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - public static native void ScoringParameters_set_failure_penalty_msat(long this_ptr, long val); - // uint16_t ScoringParameters_get_overuse_penalty_start_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr); - public static native short ScoringParameters_get_overuse_penalty_start_1024th(long this_ptr); - // void ScoringParameters_set_overuse_penalty_start_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint16_t val); - public static native void ScoringParameters_set_overuse_penalty_start_1024th(long this_ptr, short val); - // uint64_t ScoringParameters_get_overuse_penalty_msat_per_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr); - public static native long ScoringParameters_get_overuse_penalty_msat_per_1024th(long this_ptr); - // void ScoringParameters_set_overuse_penalty_msat_per_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - public static native void ScoringParameters_set_overuse_penalty_msat_per_1024th(long this_ptr, long val); - // uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoringParameters *NONNULL_PTR this_ptr); - public static native long ScoringParameters_get_failure_penalty_half_life(long this_ptr); - // void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); - public static native void ScoringParameters_set_failure_penalty_half_life(long this_ptr, long val); - // MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint16_t overuse_penalty_start_1024th_arg, uint64_t overuse_penalty_msat_per_1024th_arg, uint64_t failure_penalty_half_life_arg); - public static native long ScoringParameters_new(long base_penalty_msat_arg, long failure_penalty_msat_arg, short overuse_penalty_start_1024th_arg, long overuse_penalty_msat_per_1024th_arg, long failure_penalty_half_life_arg); - // uintptr_t ScoringParameters_clone_ptr(LDKScoringParameters *NONNULL_PTR arg); - public static native long ScoringParameters_clone_ptr(long arg); - // struct LDKScoringParameters ScoringParameters_clone(const struct LDKScoringParameters *NONNULL_PTR orig); - public static native long ScoringParameters_clone(long orig); - // struct LDKCVec_u8Z ScoringParameters_write(const struct LDKScoringParameters *NONNULL_PTR obj); - public static native byte[] ScoringParameters_write(long obj); - // struct LDKCResult_ScoringParametersDecodeErrorZ ScoringParameters_read(struct LDKu8slice ser); - public static native long ScoringParameters_read(byte[] ser); - // MUST_USE_RES struct LDKScorer Scorer_new(struct LDKScoringParameters params); - public static native long Scorer_new(long params); - // MUST_USE_RES struct LDKScorer Scorer_default(void); - public static native long Scorer_default(); - // MUST_USE_RES struct LDKScoringParameters ScoringParameters_default(void); - public static native long ScoringParameters_default(); - // struct LDKScore Scorer_as_Score(const struct LDKScorer *NONNULL_PTR this_arg); - public static native long Scorer_as_Score(long this_arg); - // struct LDKCVec_u8Z Scorer_write(const struct LDKScorer *NONNULL_PTR obj); - public static native byte[] Scorer_write(long obj); - // struct LDKCResult_ScorerDecodeErrorZ Scorer_read(struct LDKu8slice ser); - public static native long Scorer_read(byte[] ser); // void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj); public static native void ProbabilisticScorer_free(long this_obj); // void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj); @@ -6888,36 +7286,38 @@ public class bindings { public static native long ProbabilisticScoringParameters_clone_ptr(long arg); // struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig); public static native long ProbabilisticScoringParameters_clone(long orig); - // MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph); - public static native long ProbabilisticScorer_new(long params, long network_graph); + // MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger); + public static native long ProbabilisticScorer_new(long params, long network_graph, long logger); + // void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg); + public static native void ProbabilisticScorer_debug_log_liquidity_stats(long this_arg); // MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void); public static native long ProbabilisticScoringParameters_default(); // struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg); public static native long ProbabilisticScorer_as_Score(long this_arg); // struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj); public static native byte[] ProbabilisticScorer_write(long obj); - // struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b); - public static native long ProbabilisticScorer_read(byte[] ser, long arg_a, long arg_b); + // struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c); + public static native long ProbabilisticScorer_read(byte[] ser, long arg_a, long arg_b, long arg_c); // void FilesystemPersister_free(struct LDKFilesystemPersister this_obj); public static native void FilesystemPersister_free(long this_obj); // MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data); public static native long FilesystemPersister_new(String path_to_channel_data); // MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg); public static native String FilesystemPersister_get_data_dir(long this_arg); - // MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager); - public static native long FilesystemPersister_persist_manager(String data_dir, long manager); - // MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_network_graph(struct LDKStr data_dir, const struct LDKNetworkGraph *NONNULL_PTR network_graph); - public static native long FilesystemPersister_persist_network_graph(String data_dir, long network_graph); // MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager); public static native long FilesystemPersister_read_channelmonitors(long this_arg, long keys_manager); - // struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg); - public static native long FilesystemPersister_as_Persist(long this_arg); // void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj); public static native void BackgroundProcessor_free(long this_obj); - // void Persister_free(struct LDKPersister this_ptr); - public static native void Persister_free(long this_ptr); - // MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKNetGraphMsgHandler net_graph_msg_handler, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger); - public static native long BackgroundProcessor_start(long persister, long event_handler, long chain_monitor, long channel_manager, long net_graph_msg_handler, long peer_manager, long logger); + // void GossipSync_free(struct LDKGossipSync this_ptr); + public static native void GossipSync_free(long this_ptr); + // struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a); + public static native long GossipSync_p2_p(long a); + // struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a); + public static native long GossipSync_rapid(long a); + // struct LDKGossipSync GossipSync_none(void); + public static native long GossipSync_none(); + // MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKMultiThreadedLockableScore scorer); + public static native long BackgroundProcessor_start(long persister, long event_handler, long chain_monitor, long channel_manager, long gossip_sync, long peer_manager, long logger, long scorer); // MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg); public static native long BackgroundProcessor_join(long this_arg); // MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg); @@ -7310,22 +7710,20 @@ public class bindings { public static native void Payer_free(long this_ptr); // void Router_free(struct LDKRouter this_ptr); public static native void Router_free(long this_ptr); - // void RetryAttempts_free(struct LDKRetryAttempts this_obj); - public static native void RetryAttempts_free(long this_obj); - // uintptr_t RetryAttempts_get_a(const struct LDKRetryAttempts *NONNULL_PTR this_ptr); - public static native long RetryAttempts_get_a(long this_ptr); - // void RetryAttempts_set_a(struct LDKRetryAttempts *NONNULL_PTR this_ptr, uintptr_t val); - public static native void RetryAttempts_set_a(long this_ptr, long val); - // MUST_USE_RES struct LDKRetryAttempts RetryAttempts_new(uintptr_t a_arg); - public static native long RetryAttempts_new(long a_arg); - // uintptr_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg); - public static native long RetryAttempts_clone_ptr(long arg); - // struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig); - public static native long RetryAttempts_clone(long orig); - // bool RetryAttempts_eq(const struct LDKRetryAttempts *NONNULL_PTR a, const struct LDKRetryAttempts *NONNULL_PTR b); - public static native boolean RetryAttempts_eq(long a, long b); - // uint64_t RetryAttempts_hash(const struct LDKRetryAttempts *NONNULL_PTR o); - public static native long RetryAttempts_hash(long o); + // void Retry_free(struct LDKRetry this_ptr); + public static native void Retry_free(long this_ptr); + // uintptr_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg); + public static native long Retry_clone_ptr(long arg); + // struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig); + public static native long Retry_clone(long orig); + // struct LDKRetry Retry_attempts(uintptr_t a); + public static native long Retry_attempts(long a); + // struct LDKRetry Retry_timeout(uint64_t a); + public static native long Retry_timeout(long a); + // bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b); + public static native boolean Retry_eq(long a, long b); + // uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o); + public static native long Retry_hash(long o); // void PaymentError_free(struct LDKPaymentError this_ptr); public static native void PaymentError_free(long this_ptr); // uintptr_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg); @@ -7338,8 +7736,8 @@ public class bindings { public static native long PaymentError_routing(long a); // struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a); public static native long PaymentError_sending(long a); - // MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts); - public static native long InvoicePayer_new(long payer, long router, long scorer, long logger, long event_handler, long retry_attempts); + // MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetry retry); + public static native long InvoicePayer_new(long payer, long router, long scorer, long logger, long event_handler, long retry); // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice); public static native long InvoicePayer_pay_invoice(long this_arg, long invoice); // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_zero_value_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats); @@ -7350,18 +7748,18 @@ public class bindings { public static native void InvoicePayer_remove_cached_payment(long this_arg, byte[] payment_hash); // struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg); public static native long InvoicePayer_as_EventHandler(long this_arg); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKStr description, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network); - public static native long create_phantom_invoice(long amt_msat, String description, byte[] payment_hash, byte[] payment_secret, long[] phantom_route_hints, long keys_manager, Currency network); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network); - public static native long create_phantom_invoice_with_description_hash(long amt_msat, long description_hash, byte[] payment_hash, byte[] payment_secret, long[] phantom_route_hints, long keys_manager, Currency network); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description); - public static native long create_invoice_from_channelmanager(long channelmanager, long keys_manager, Currency network, long amt_msat, String description); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash); - public static native long create_invoice_from_channelmanager_with_description_hash(long channelmanager, long keys_manager, Currency network, long amt_msat, long description_hash); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch); - public static native long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long channelmanager, long keys_manager, Currency network, long amt_msat, long description_hash, long duration_since_epoch); - // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch); - public static native long create_invoice_from_channelmanager_and_duration_since_epoch(long channelmanager, long keys_manager, Currency network, long amt_msat, String description, long duration_since_epoch); + // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network); + public static native long create_phantom_invoice(long amt_msat, byte[] payment_hash, String description, int invoice_expiry_delta_secs, long[] phantom_route_hints, long keys_manager, Currency network); + // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network); + public static native long create_phantom_invoice_with_description_hash(long amt_msat, byte[] payment_hash, int invoice_expiry_delta_secs, long description_hash, long[] phantom_route_hints, long keys_manager, Currency network); + // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs); + public static native long create_invoice_from_channelmanager(long channelmanager, long keys_manager, Currency network, long amt_msat, String description, int invoice_expiry_delta_secs); + // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs); + public static native long create_invoice_from_channelmanager_with_description_hash(long channelmanager, long keys_manager, Currency network, long amt_msat, long description_hash, int invoice_expiry_delta_secs); + // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs); + public static native long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long channelmanager, long keys_manager, Currency network, long amt_msat, long description_hash, long duration_since_epoch, int invoice_expiry_delta_secs); + // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs); + public static native long create_invoice_from_channelmanager_and_duration_since_epoch(long channelmanager, long keys_manager, Currency network, long amt_msat, String description, long duration_since_epoch, int invoice_expiry_delta_secs); // void DefaultRouter_free(struct LDKDefaultRouter this_obj); public static native void DefaultRouter_free(long this_obj); // MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes); @@ -7388,4 +7786,24 @@ public class bindings { public static native String Currency_to_str(long o); // struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o); public static native String SiPrefix_to_str(long o); + // void RapidGossipSync_free(struct LDKRapidGossipSync this_obj); + public static native void RapidGossipSync_free(long this_obj); + // MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph); + public static native long RapidGossipSync_new(long network_graph); + // MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path); + public static native long RapidGossipSync_sync_network_graph_with_file_path(long this_arg, String sync_path); + // MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg); + public static native boolean RapidGossipSync_is_initial_sync_complete(long this_arg); + // void GraphSyncError_free(struct LDKGraphSyncError this_ptr); + public static native void GraphSyncError_free(long this_ptr); + // uintptr_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg); + public static native long GraphSyncError_clone_ptr(long arg); + // struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig); + public static native long GraphSyncError_clone(long orig); + // struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a); + public static native long GraphSyncError_decode_error(long a); + // struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a); + public static native long GraphSyncError_lightning_error(long a); + // MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data); + public static native long RapidGossipSync_update_network_graph(long this_arg, byte[] update_data); } diff --git a/src/main/java/org/ldk/structs/APIError.java b/src/main/java/org/ldk/structs/APIError.java index f226ddcc..1cdc5ab7 100644 --- a/src/main/java/org/ldk/structs/APIError.java +++ b/src/main/java/org/ldk/structs/APIError.java @@ -133,7 +133,7 @@ public class APIError extends CommonBase { private IncompatibleShutdownScript(long ptr, bindings.LDKAPIError.IncompatibleShutdownScript obj) { super(null, ptr); long script = obj.script; - ShutdownScript script_hu_conv = null; if (script < 0 || script > 4096) { script_hu_conv = new ShutdownScript(null, script); } + org.ldk.structs.ShutdownScript script_hu_conv = null; if (script < 0 || script > 4096) { script_hu_conv = new org.ldk.structs.ShutdownScript(null, script); } script_hu_conv.ptrs_to.add(this); this.script = script_hu_conv; } diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index 94399e61..aee61b8f 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -286,7 +286,7 @@ public class AcceptChannel extends CommonBase { long ret = bindings.AcceptChannel_get_channel_type(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -319,7 +319,7 @@ public class AcceptChannel extends CommonBase { long ret = bindings.AcceptChannel_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new AcceptChannel(null, ret); } + org.ldk.structs.AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannel(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Access.java b/src/main/java/org/ldk/structs/Access.java index a244405e..169e9015 100644 --- a/src/main/java/org/ldk/structs/Access.java +++ b/src/main/java/org/ldk/structs/Access.java @@ -31,7 +31,7 @@ public class Access extends CommonBase { * Returns an error if `genesis_hash` is for a different chain or if such a transaction output * is unknown. * - * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id + * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id */ Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id); } @@ -53,7 +53,7 @@ public class Access extends CommonBase { * Returns an error if `genesis_hash` is for a different chain or if such a transaction output * is unknown. * - * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id + * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id */ public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) { long ret = bindings.Access_get_utxo(this.ptr, InternalUtils.check_arr_len(genesis_hash, 32), short_channel_id); diff --git a/src/main/java/org/ldk/structs/AnnouncementSignatures.java b/src/main/java/org/ldk/structs/AnnouncementSignatures.java index d4a712f3..dee5e5ed 100644 --- a/src/main/java/org/ldk/structs/AnnouncementSignatures.java +++ b/src/main/java/org/ldk/structs/AnnouncementSignatures.java @@ -102,7 +102,7 @@ public class AnnouncementSignatures extends CommonBase { Reference.reachabilityFence(node_signature_arg); Reference.reachabilityFence(bitcoin_signature_arg); if (ret >= 0 && ret <= 4096) { return null; } - AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new AnnouncementSignatures(null, ret); } + org.ldk.structs.AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -120,7 +120,7 @@ public class AnnouncementSignatures extends CommonBase { long ret = bindings.AnnouncementSignatures_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new AnnouncementSignatures(null, ret); } + org.ldk.structs.AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/BackgroundProcessor.java b/src/main/java/org/ldk/structs/BackgroundProcessor.java index af09b461..06e59697 100644 --- a/src/main/java/org/ldk/structs/BackgroundProcessor.java +++ b/src/main/java/org/ldk/structs/BackgroundProcessor.java @@ -18,8 +18,8 @@ import javax.annotation.Nullable; * [`ChannelManager`] persistence should be done in the background. * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`] * at the appropriate intervals. - * Calling [`NetworkGraph::remove_stale_channels`] (if a [`NetGraphMsgHandler`] is provided to - * [`BackgroundProcessor::start`]). + * Calling [`NetworkGraph::remove_stale_channels`] (if a [`GossipSync`] with a [`NetworkGraph`] + * is provided to [`BackgroundProcessor::start`]). * * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied * upon as doing so may result in high latency. @@ -56,12 +56,12 @@ public class BackgroundProcessor extends CommonBase { * * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a - * [`ChannelManager`]. See [`FilesystemPersister::persist_manager`] for Rust-Lightning's + * [`ChannelManager`]. See the `lightning-persister` crate for LDK's * provided implementation. * - * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk. See - * [`NetworkGraph::write`] for writing out a [`NetworkGraph`]. See [`FilesystemPersister::persist_network_graph`] - * for Rust-Lightning's provided implementation. + * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if + * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`]. + * See the `lightning-persister` crate for LDK's provided implementation. * * Typically, users should either implement [`Persister::persist_manager`] to never return an * error or call [`join`] and handle any error that may arise. For the latter case, @@ -72,39 +72,46 @@ public class BackgroundProcessor extends CommonBase { * `event_handler` is responsible for handling events that users should be notified of (e.g., * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common * functionality implemented by other handlers. - * [`NetGraphMsgHandler`] if given will update the [`NetworkGraph`] based on payment failures. + * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures. + * + * # Rapid Gossip Sync + * + * If rapid gossip sync is meant to run at startup, pass a [`RapidGossipSync`] to `gossip_sync` + * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance + * until the [`RapidGossipSync`] instance completes its first sync. * * [top-level documentation]: BackgroundProcessor * [`join`]: Self::join * [`stop`]: Self::stop * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable - * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager - * [`FilesystemPersister::persist_network_graph`]: lightning_persister::FilesystemPersister::persist_network_graph - * [`NetworkGraph`]: lightning::routing::network_graph::NetworkGraph - * [`NetworkGraph::write`]: lightning::routing::network_graph::NetworkGraph#impl-Writeable + * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager + * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph + * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph + * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable * - * Note that net_graph_msg_handler (or a relevant inner pointer) may be NULL or all-0s to represent None + * Note that scorer (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static BackgroundProcessor start(Persister persister, EventHandler event_handler, ChainMonitor chain_monitor, ChannelManager channel_manager, @Nullable NetGraphMsgHandler net_graph_msg_handler, PeerManager peer_manager, Logger logger) { - long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr & ~1, channel_manager == null ? 0 : channel_manager.ptr & ~1, net_graph_msg_handler == null ? 0 : net_graph_msg_handler.ptr & ~1, peer_manager == null ? 0 : peer_manager.ptr & ~1, logger == null ? 0 : logger.ptr); + public static BackgroundProcessor start(Persister persister, EventHandler event_handler, ChainMonitor chain_monitor, ChannelManager channel_manager, GossipSync gossip_sync, PeerManager peer_manager, Logger logger, @Nullable MultiThreadedLockableScore scorer) { + long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr & ~1, channel_manager == null ? 0 : channel_manager.ptr & ~1, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr & ~1, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr & ~1); Reference.reachabilityFence(persister); Reference.reachabilityFence(event_handler); Reference.reachabilityFence(chain_monitor); Reference.reachabilityFence(channel_manager); - Reference.reachabilityFence(net_graph_msg_handler); + Reference.reachabilityFence(gossip_sync); Reference.reachabilityFence(peer_manager); Reference.reachabilityFence(logger); + Reference.reachabilityFence(scorer); if (ret >= 0 && ret <= 4096) { return null; } - BackgroundProcessor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BackgroundProcessor(null, ret); } + org.ldk.structs.BackgroundProcessor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BackgroundProcessor(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(persister); ret_hu_conv.ptrs_to.add(event_handler); ret_hu_conv.ptrs_to.add(chain_monitor); ret_hu_conv.ptrs_to.add(channel_manager); - ret_hu_conv.ptrs_to.add(net_graph_msg_handler); ret_hu_conv.ptrs_to.add(peer_manager); ret_hu_conv.ptrs_to.add(logger); + ret_hu_conv.ptrs_to.add(scorer); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/BaseSign.java b/src/main/java/org/ldk/structs/BaseSign.java index 7bc6174c..9e5d2773 100644 --- a/src/main/java/org/ldk/structs/BaseSign.java +++ b/src/main/java/org/ldk/structs/BaseSign.java @@ -224,7 +224,7 @@ public class BaseSign extends CommonBase { return result; } @Override public long validate_holder_commitment(long holder_tx, byte[][] preimages) { - HolderCommitmentTransaction holder_tx_hu_conv = null; if (holder_tx < 0 || holder_tx > 4096) { holder_tx_hu_conv = new HolderCommitmentTransaction(null, holder_tx); } + org.ldk.structs.HolderCommitmentTransaction holder_tx_hu_conv = null; if (holder_tx < 0 || holder_tx > 4096) { holder_tx_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, holder_tx); } Result_NoneNoneZ ret = arg.validate_holder_commitment(holder_tx_hu_conv, preimages); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); @@ -237,7 +237,7 @@ public class BaseSign extends CommonBase { return result; } @Override public long sign_counterparty_commitment(long commitment_tx, byte[][] preimages) { - CommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new CommitmentTransaction(null, commitment_tx); } + org.ldk.structs.CommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new org.ldk.structs.CommitmentTransaction(null, commitment_tx); } Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv, preimages); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); @@ -250,7 +250,7 @@ public class BaseSign extends CommonBase { return result; } @Override public long sign_holder_commitment_and_htlcs(long commitment_tx) { - HolderCommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new HolderCommitmentTransaction(null, commitment_tx); } + org.ldk.structs.HolderCommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, commitment_tx); } Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(commitment_tx_hu_conv); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); @@ -263,35 +263,35 @@ public class BaseSign extends CommonBase { return result; } @Override public long sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc) { - HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new HTLCOutputInCommitment(null, htlc); } + org.ldk.structs.HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, htlc); } Result_SignatureNoneZ ret = arg.sign_justice_revoked_htlc(justice_tx, input, amount, per_commitment_key, htlc_hu_conv); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc) { - HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new HTLCOutputInCommitment(null, htlc); } + org.ldk.structs.HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, htlc); } Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_closing_transaction(long closing_tx) { - ClosingTransaction closing_tx_hu_conv = null; if (closing_tx < 0 || closing_tx > 4096) { closing_tx_hu_conv = new ClosingTransaction(null, closing_tx); } + org.ldk.structs.ClosingTransaction closing_tx_hu_conv = null; if (closing_tx < 0 || closing_tx > 4096) { closing_tx_hu_conv = new org.ldk.structs.ClosingTransaction(null, closing_tx); } Result_SignatureNoneZ ret = arg.sign_closing_transaction(closing_tx_hu_conv); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long sign_channel_announcement(long msg) { - UnsignedChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UnsignedChannelAnnouncement(null, msg); } + org.ldk.structs.UnsignedChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, msg); } Result_C2Tuple_SignatureSignatureZNoneZ ret = arg.sign_channel_announcement(msg_hu_conv); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public void ready_channel(long channel_parameters) { - ChannelTransactionParameters channel_parameters_hu_conv = null; if (channel_parameters < 0 || channel_parameters > 4096) { channel_parameters_hu_conv = new ChannelTransactionParameters(null, channel_parameters); } + org.ldk.structs.ChannelTransactionParameters channel_parameters_hu_conv = null; if (channel_parameters < 0 || channel_parameters > 4096) { channel_parameters_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, channel_parameters); } arg.ready_channel(channel_parameters_hu_conv); Reference.reachabilityFence(arg); } @@ -587,7 +587,7 @@ public class BaseSign extends CommonBase { long ret = bindings.BaseSign_get_pubkeys(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } + org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/BestBlock.java b/src/main/java/org/ldk/structs/BestBlock.java index f746b47d..fd972070 100644 --- a/src/main/java/org/ldk/structs/BestBlock.java +++ b/src/main/java/org/ldk/structs/BestBlock.java @@ -33,7 +33,7 @@ public class BestBlock extends CommonBase { long ret = bindings.BestBlock_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -46,7 +46,7 @@ public class BestBlock extends CommonBase { long ret = bindings.BestBlock_from_genesis(network); Reference.reachabilityFence(network); if (ret >= 0 && ret <= 4096) { return null; } - BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -59,7 +59,7 @@ public class BestBlock extends CommonBase { Reference.reachabilityFence(block_hash); Reference.reachabilityFence(height); if (ret >= 0 && ret <= 4096) { return null; } - BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/BigSize.java b/src/main/java/org/ldk/structs/BigSize.java new file mode 100644 index 00000000..7ad1ef63 --- /dev/null +++ b/src/main/java/org/ldk/structs/BigSize.java @@ -0,0 +1,53 @@ +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; + + +/** + * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's + * variable-length integers except that it is serialized in big-endian instead of little-endian. + * + * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be + * encoded in several different ways, which we must check for at deserialization-time. Thus, if + * you're looking for an example of a variable-length integer to use for your own project, move + * along, this is a rather poor design. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class BigSize extends CommonBase { + BigSize(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.BigSize_free(ptr); } + } + + public long get_a() { + long ret = bindings.BigSize_get_a(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + public void set_a(long val) { + bindings.BigSize_set_a(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new BigSize given each field + */ + public static BigSize of(long a_arg) { + long ret = bindings.BigSize_new(a_arg); + Reference.reachabilityFence(a_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BigSize ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BigSize(null, ret); } + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java b/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java index 2df19906..3f340e75 100644 --- a/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java @@ -70,7 +70,7 @@ public class BuiltCommitmentTransaction extends CommonBase { Reference.reachabilityFence(transaction_arg); Reference.reachabilityFence(txid_arg); if (ret >= 0 && ret <= 4096) { return null; } - BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BuiltCommitmentTransaction(null, ret); } + org.ldk.structs.BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BuiltCommitmentTransaction(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -88,7 +88,7 @@ public class BuiltCommitmentTransaction extends CommonBase { long ret = bindings.BuiltCommitmentTransaction_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BuiltCommitmentTransaction(null, ret); } + org.ldk.structs.BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BuiltCommitmentTransaction(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChainMonitor.java b/src/main/java/org/ldk/structs/ChainMonitor.java index df02a761..381ab61b 100644 --- a/src/main/java/org/ldk/structs/ChainMonitor.java +++ b/src/main/java/org/ldk/structs/ChainMonitor.java @@ -45,7 +45,7 @@ public class ChainMonitor extends CommonBase { Reference.reachabilityFence(feeest); Reference.reachabilityFence(persister); if (ret >= 0 && ret <= 4096) { return null; } - ChainMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChainMonitor(null, ret); } + org.ldk.structs.ChainMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChainMonitor(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(chain_source); ret_hu_conv.ptrs_to.add(broadcaster); @@ -110,7 +110,7 @@ public class ChainMonitor extends CommonBase { OutPoint[] ret_conv_10_arr = new OutPoint[ret_conv_10_len]; for (int k = 0; k < ret_conv_10_len; k++) { long ret_conv_10 = ret[k]; - OutPoint ret_conv_10_hu_conv = null; if (ret_conv_10 < 0 || ret_conv_10 > 4096) { ret_conv_10_hu_conv = new OutPoint(null, ret_conv_10); } + org.ldk.structs.OutPoint ret_conv_10_hu_conv = null; if (ret_conv_10 < 0 || ret_conv_10 > 4096) { ret_conv_10_hu_conv = new org.ldk.structs.OutPoint(null, ret_conv_10); } ret_conv_10_hu_conv.ptrs_to.add(this); ret_conv_10_arr[k] = ret_conv_10_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChainParameters.java b/src/main/java/org/ldk/structs/ChainParameters.java index 72aafcf4..c3ed2ee1 100644 --- a/src/main/java/org/ldk/structs/ChainParameters.java +++ b/src/main/java/org/ldk/structs/ChainParameters.java @@ -51,7 +51,7 @@ public class ChainParameters extends CommonBase { long ret = bindings.ChainParameters_get_best_block(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -75,7 +75,7 @@ public class ChainParameters extends CommonBase { Reference.reachabilityFence(network_arg); Reference.reachabilityFence(best_block_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChainParameters(null, ret); } + org.ldk.structs.ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChainParameters(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -93,7 +93,7 @@ public class ChainParameters extends CommonBase { long ret = bindings.ChainParameters_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChainParameters(null, ret); } + org.ldk.structs.ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChainParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelAnnouncement.java b/src/main/java/org/ldk/structs/ChannelAnnouncement.java index 8ab2d90c..5a2f6c1c 100644 --- a/src/main/java/org/ldk/structs/ChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/ChannelAnnouncement.java @@ -99,7 +99,7 @@ public class ChannelAnnouncement extends CommonBase { long ret = bindings.ChannelAnnouncement_get_contents(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); } + org.ldk.structs.UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -124,7 +124,7 @@ public class ChannelAnnouncement extends CommonBase { Reference.reachabilityFence(bitcoin_signature_2_arg); Reference.reachabilityFence(contents_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); } + org.ldk.structs.ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -142,7 +142,7 @@ public class ChannelAnnouncement extends CommonBase { long ret = bindings.ChannelAnnouncement_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); } + org.ldk.structs.ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelConfig.java b/src/main/java/org/ldk/structs/ChannelConfig.java index eda992d4..df3ce167 100644 --- a/src/main/java/org/ldk/structs/ChannelConfig.java +++ b/src/main/java/org/ldk/structs/ChannelConfig.java @@ -338,7 +338,7 @@ public class ChannelConfig extends CommonBase { Reference.reachabilityFence(max_dust_htlc_exposure_msat_arg); Reference.reachabilityFence(force_close_avoidance_max_fee_satoshis_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelConfig(null, ret); } + org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -356,7 +356,7 @@ public class ChannelConfig extends CommonBase { long ret = bindings.ChannelConfig_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelConfig(null, ret); } + org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -367,7 +367,7 @@ public class ChannelConfig extends CommonBase { public static ChannelConfig with_default() { long ret = bindings.ChannelConfig_default(); if (ret >= 0 && ret <= 4096) { return null; } - ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelConfig(null, ret); } + org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelCounterparty.java b/src/main/java/org/ldk/structs/ChannelCounterparty.java index 2695fc45..93d0688f 100644 --- a/src/main/java/org/ldk/structs/ChannelCounterparty.java +++ b/src/main/java/org/ldk/structs/ChannelCounterparty.java @@ -48,7 +48,7 @@ public class ChannelCounterparty extends CommonBase { long ret = bindings.ChannelCounterparty_get_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -105,7 +105,7 @@ public class ChannelCounterparty extends CommonBase { long ret = bindings.ChannelCounterparty_get_forwarding_info(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyForwardingInfo(null, ret); } + org.ldk.structs.CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyForwardingInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -122,17 +122,65 @@ public class ChannelCounterparty extends CommonBase { Reference.reachabilityFence(val); } + /** + * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field + * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message + * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107. + */ + public Option_u64Z get_outbound_htlc_minimum_msat() { + long ret = bindings.ChannelCounterparty_get_outbound_htlc_minimum_msat(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); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field + * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message + * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107. + */ + public void set_outbound_htlc_minimum_msat(Option_u64Z val) { + bindings.ChannelCounterparty_set_outbound_htlc_minimum_msat(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The largest value HTLC (in msat) the remote peer currently will accept, for this channel. + */ + public Option_u64Z get_outbound_htlc_maximum_msat() { + long ret = bindings.ChannelCounterparty_get_outbound_htlc_maximum_msat(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); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The largest value HTLC (in msat) the remote peer currently will accept, for this channel. + */ + public void set_outbound_htlc_maximum_msat(Option_u64Z val) { + bindings.ChannelCounterparty_set_outbound_htlc_maximum_msat(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new ChannelCounterparty given each field */ - public static ChannelCounterparty of(byte[] node_id_arg, InitFeatures features_arg, long unspendable_punishment_reserve_arg, CounterpartyForwardingInfo forwarding_info_arg) { - long ret = bindings.ChannelCounterparty_new(InternalUtils.check_arr_len(node_id_arg, 33), features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1); + public static ChannelCounterparty of(byte[] node_id_arg, InitFeatures features_arg, long unspendable_punishment_reserve_arg, CounterpartyForwardingInfo forwarding_info_arg, Option_u64Z outbound_htlc_minimum_msat_arg, Option_u64Z outbound_htlc_maximum_msat_arg) { + long ret = bindings.ChannelCounterparty_new(InternalUtils.check_arr_len(node_id_arg, 33), features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1, outbound_htlc_minimum_msat_arg.ptr, outbound_htlc_maximum_msat_arg.ptr); Reference.reachabilityFence(node_id_arg); Reference.reachabilityFence(features_arg); Reference.reachabilityFence(unspendable_punishment_reserve_arg); Reference.reachabilityFence(forwarding_info_arg); + Reference.reachabilityFence(outbound_htlc_minimum_msat_arg); + Reference.reachabilityFence(outbound_htlc_maximum_msat_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelCounterparty(null, ret); } + org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -150,7 +198,7 @@ public class ChannelCounterparty extends CommonBase { long ret = bindings.ChannelCounterparty_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelCounterparty(null, ret); } + org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index e56f706c..c7331019 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -51,7 +51,7 @@ public class ChannelDetails extends CommonBase { long ret = bindings.ChannelDetails_get_counterparty(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelCounterparty(null, ret); } + org.ldk.structs.ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelCounterparty(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -79,7 +79,7 @@ public class ChannelDetails extends CommonBase { long ret = bindings.ChannelDetails_get_funding_txo(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -111,7 +111,7 @@ public class ChannelDetails extends CommonBase { long ret = bindings.ChannelDetails_get_channel_type(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -136,8 +136,14 @@ public class ChannelDetails extends CommonBase { * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound * payments instead of this. See [`get_inbound_payment_scid`]. * + * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may + * be used in place of this in outbound routes. See [`get_outbound_payment_scid`]. + * * [`inbound_scid_alias`]: Self::inbound_scid_alias + * [`outbound_scid_alias`]: Self::outbound_scid_alias * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid + * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid + * [`confirmations_required`]: Self::confirmations_required */ public Option_u64Z get_short_channel_id() { long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr); @@ -155,8 +161,14 @@ public class ChannelDetails extends CommonBase { * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound * payments instead of this. See [`get_inbound_payment_scid`]. * + * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may + * be used in place of this in outbound routes. See [`get_outbound_payment_scid`]. + * * [`inbound_scid_alias`]: Self::inbound_scid_alias + * [`outbound_scid_alias`]: Self::outbound_scid_alias * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid + * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid + * [`confirmations_required`]: Self::confirmations_required */ public void set_short_channel_id(Option_u64Z val) { bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr); @@ -164,6 +176,43 @@ public class ChannelDetails extends CommonBase { Reference.reachabilityFence(val); } + /** + * An optional [`short_channel_id`] alias for this channel, randomly generated by us and + * usable in place of [`short_channel_id`] to reference the channel in outbound routes when + * the channel has not yet been confirmed (as long as [`confirmations_required`] is + * `Some(0)`). + * + * This will be `None` as long as the channel is not available for routing outbound payments. + * + * [`short_channel_id`]: Self::short_channel_id + * [`confirmations_required`]: Self::confirmations_required + */ + public Option_u64Z get_outbound_scid_alias() { + long ret = bindings.ChannelDetails_get_outbound_scid_alias(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); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * An optional [`short_channel_id`] alias for this channel, randomly generated by us and + * usable in place of [`short_channel_id`] to reference the channel in outbound routes when + * the channel has not yet been confirmed (as long as [`confirmations_required`] is + * `Some(0)`). + * + * This will be `None` as long as the channel is not available for routing outbound payments. + * + * [`short_channel_id`]: Self::short_channel_id + * [`confirmations_required`]: Self::confirmations_required + */ + public void set_outbound_scid_alias(Option_u64Z val) { + bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * An optional [`short_channel_id`] alias for this channel, randomly generated by our * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our @@ -346,6 +395,34 @@ public class ChannelDetails extends CommonBase { Reference.reachabilityFence(val); } + /** + * The available outbound capacity for sending a single HTLC to the remote peer. This is + * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by + * 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::balance_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); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The available outbound capacity for sending a single HTLC to the remote peer. This is + * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by + * 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::balance_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); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * The available inbound capacity for the remote peer to send HTLCs to us. This does not * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not @@ -473,40 +550,40 @@ public class ChannelDetails extends CommonBase { } /** - * True if the channel is confirmed, funding_locked messages have been exchanged, and the - * channel is not currently being shut down. `funding_locked` message exchange implies the + * True if the channel is confirmed, channel_ready messages have been exchanged, and the + * channel is not currently being shut down. `channel_ready` message exchange implies the * required confirmation count has been reached (and we were connected to the peer at some * point after the funding transaction received enough confirmations). The required * confirmation count is provided in [`confirmations_required`]. * * [`confirmations_required`]: ChannelDetails::confirmations_required */ - public boolean get_is_funding_locked() { - boolean ret = bindings.ChannelDetails_get_is_funding_locked(this.ptr); + public boolean get_is_channel_ready() { + boolean ret = bindings.ChannelDetails_get_is_channel_ready(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * True if the channel is confirmed, funding_locked messages have been exchanged, and the - * channel is not currently being shut down. `funding_locked` message exchange implies the + * True if the channel is confirmed, channel_ready messages have been exchanged, and the + * channel is not currently being shut down. `channel_ready` message exchange implies the * required confirmation count has been reached (and we were connected to the peer at some * point after the funding transaction received enough confirmations). The required * confirmation count is provided in [`confirmations_required`]. * * [`confirmations_required`]: ChannelDetails::confirmations_required */ - public void set_is_funding_locked(boolean val) { - bindings.ChannelDetails_set_is_funding_locked(this.ptr, val); + public void set_is_channel_ready(boolean val) { + bindings.ChannelDetails_set_is_channel_ready(this.ptr, val); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) + * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b) * the peer is connected, and (c) the channel is not currently negotiating a shutdown. * - * This is a strict superset of `is_funding_locked`. + * This is a strict superset of `is_channel_ready`. */ public boolean get_is_usable() { boolean ret = bindings.ChannelDetails_get_is_usable(this.ptr); @@ -515,10 +592,10 @@ public class ChannelDetails extends CommonBase { } /** - * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) + * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b) * the peer is connected, and (c) the channel is not currently negotiating a shutdown. * - * This is a strict superset of `is_funding_locked`. + * This is a strict superset of `is_channel_ready`. */ public void set_is_usable(boolean val) { bindings.ChannelDetails_set_is_usable(this.ptr, val); @@ -544,31 +621,79 @@ public class ChannelDetails extends CommonBase { Reference.reachabilityFence(val); } + /** + * The smallest value HTLC (in msat) we will accept, for this channel. This field + * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107 + */ + public Option_u64Z get_inbound_htlc_minimum_msat() { + long ret = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(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); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The smallest value HTLC (in msat) we will accept, for this channel. This field + * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107 + */ + public void set_inbound_htlc_minimum_msat(Option_u64Z val) { + bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The largest value HTLC (in msat) we currently will accept, for this channel. + */ + public Option_u64Z get_inbound_htlc_maximum_msat() { + long ret = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(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); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The largest value HTLC (in msat) we currently will accept, for this channel. + */ + public void set_inbound_htlc_maximum_msat(Option_u64Z val) { + bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new ChannelDetails given each field */ - public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, ChannelTypeFeatures channel_type_arg, Option_u64Z short_channel_id_arg, Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) { - long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, channel_type_arg == null ? 0 : channel_type_arg.ptr & ~1, short_channel_id_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); + public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, ChannelTypeFeatures channel_type_arg, Option_u64Z short_channel_id_arg, Option_u64Z outbound_scid_alias_arg, Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, boolean is_usable_arg, boolean is_public_arg, Option_u64Z inbound_htlc_minimum_msat_arg, Option_u64Z inbound_htlc_maximum_msat_arg) { + long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, channel_type_arg == null ? 0 : channel_type_arg.ptr & ~1, 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, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr); Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(counterparty_arg); Reference.reachabilityFence(funding_txo_arg); Reference.reachabilityFence(channel_type_arg); Reference.reachabilityFence(short_channel_id_arg); + Reference.reachabilityFence(outbound_scid_alias_arg); Reference.reachabilityFence(inbound_scid_alias_arg); Reference.reachabilityFence(channel_value_satoshis_arg); Reference.reachabilityFence(unspendable_punishment_reserve_arg); Reference.reachabilityFence(user_channel_id_arg); Reference.reachabilityFence(balance_msat_arg); Reference.reachabilityFence(outbound_capacity_msat_arg); + Reference.reachabilityFence(next_outbound_htlc_limit_msat_arg); Reference.reachabilityFence(inbound_capacity_msat_arg); Reference.reachabilityFence(confirmations_required_arg); Reference.reachabilityFence(force_close_spend_delay_arg); Reference.reachabilityFence(is_outbound_arg); - Reference.reachabilityFence(is_funding_locked_arg); + Reference.reachabilityFence(is_channel_ready_arg); Reference.reachabilityFence(is_usable_arg); Reference.reachabilityFence(is_public_arg); + Reference.reachabilityFence(inbound_htlc_minimum_msat_arg); + Reference.reachabilityFence(inbound_htlc_maximum_msat_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelDetails(null, ret); } + org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -586,7 +711,7 @@ public class ChannelDetails extends CommonBase { long ret = bindings.ChannelDetails_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelDetails(null, ret); } + org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -608,6 +733,23 @@ public class ChannelDetails extends CommonBase { return ret_hu_conv; } + /** + * Gets the current SCID which should be used to identify this channel for outbound payments. + * This should be used in [`Route`]s to describe the first hop or in other contexts where + * we're sending or forwarding a payment outbound over this channel. + * + * This is either the [`ChannelDetails::short_channel_id`], if set, or the + * [`ChannelDetails::outbound_scid_alias`]. See those for more information. + */ + public Option_u64Z get_outbound_payment_scid() { + long ret = bindings.ChannelDetails_get_outbound_payment_scid(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); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + /** * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read */ diff --git a/src/main/java/org/ldk/structs/ChannelFeatures.java b/src/main/java/org/ldk/structs/ChannelFeatures.java index 609de36d..42dd67c7 100644 --- a/src/main/java/org/ldk/structs/ChannelFeatures.java +++ b/src/main/java/org/ldk/structs/ChannelFeatures.java @@ -50,7 +50,7 @@ public class ChannelFeatures extends CommonBase { long ret = bindings.ChannelFeatures_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); } + org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -61,7 +61,7 @@ public class ChannelFeatures extends CommonBase { public static ChannelFeatures empty() { long ret = bindings.ChannelFeatures_empty(); if (ret >= 0 && ret <= 4096) { return null; } - ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); } + org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -72,7 +72,7 @@ public class ChannelFeatures extends CommonBase { public static ChannelFeatures known() { long ret = bindings.ChannelFeatures_known(); if (ret >= 0 && ret <= 4096) { return null; } - ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); } + org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java index f6a3bfb6..cea0ccc5 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java @@ -27,7 +27,15 @@ public class ChannelHandshakeConfig extends CommonBase { * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the * equivalent limit applied to outbound channels). * + * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment + * transaction before operation. If you wish to accept channels with zero confirmations, see + * [`UserConfig::manually_accept_inbound_channels`] and + * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]. + * * Default value: 6. + * + * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel + * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf */ public int get_minimum_depth() { int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr); @@ -40,7 +48,15 @@ public class ChannelHandshakeConfig extends CommonBase { * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the * equivalent limit applied to outbound channels). * + * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment + * transaction before operation. If you wish to accept channels with zero confirmations, see + * [`UserConfig::manually_accept_inbound_channels`] and + * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]. + * * Default value: 6. + * + * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel + * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf */ public void set_minimum_depth(int val) { bindings.ChannelHandshakeConfig_set_minimum_depth(this.ptr, val); @@ -124,6 +140,68 @@ public class ChannelHandshakeConfig extends CommonBase { Reference.reachabilityFence(val); } + /** + * Sets the percentage of the channel value we will cap the total value of outstanding inbound + * HTLCs to. + * + * This can be set to a value between 1-100, where the value corresponds to the percent of the + * channel value in whole percentages. + * + * Note that: + * If configured to another value than the default value 10, any new channels created with + * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the + * `ChannelManager`. + * + * This caps the total value for inbound HTLCs in-flight only, and there's currently + * no way to configure the cap for the total value of outbound HTLCs in-flight. + * + * The requirements for your node being online to ensure the safety of HTLC-encumbered funds + * are different from the non-HTLC-encumbered funds. This makes this an important knob to + * restrict exposure to loss due to being offline for too long. + * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`] + * for more information. + * + * Default value: 10. + * Minimum value: 1, any values less than 1 will be treated as 1 instead. + * Maximum value: 100, any values larger than 100 will be treated as 100 instead. + */ + public byte get_max_inbound_htlc_value_in_flight_percent_of_channel() { + byte ret = bindings.ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Sets the percentage of the channel value we will cap the total value of outstanding inbound + * HTLCs to. + * + * This can be set to a value between 1-100, where the value corresponds to the percent of the + * channel value in whole percentages. + * + * Note that: + * If configured to another value than the default value 10, any new channels created with + * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the + * `ChannelManager`. + * + * This caps the total value for inbound HTLCs in-flight only, and there's currently + * no way to configure the cap for the total value of outbound HTLCs in-flight. + * + * The requirements for your node being online to ensure the safety of HTLC-encumbered funds + * are different from the non-HTLC-encumbered funds. This makes this an important knob to + * restrict exposure to loss due to being offline for too long. + * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`] + * for more information. + * + * Default value: 10. + * Minimum value: 1, any values less than 1 will be treated as 1 instead. + * Maximum value: 100, any values larger than 100 will be treated as 100 instead. + */ + public void set_max_inbound_htlc_value_in_flight_percent_of_channel(byte val) { + bindings.ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the * BOLTs) option for outbound private channels. This provides better privacy by not including @@ -185,14 +263,15 @@ public class ChannelHandshakeConfig extends CommonBase { /** * Constructs a new ChannelHandshakeConfig given each field */ - public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, boolean negotiate_scid_privacy_arg) { - long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, negotiate_scid_privacy_arg); + public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg, byte max_inbound_htlc_value_in_flight_percent_of_channel_arg, boolean negotiate_scid_privacy_arg) { + long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg); Reference.reachabilityFence(minimum_depth_arg); Reference.reachabilityFence(our_to_self_delay_arg); Reference.reachabilityFence(our_htlc_minimum_msat_arg); + Reference.reachabilityFence(max_inbound_htlc_value_in_flight_percent_of_channel_arg); Reference.reachabilityFence(negotiate_scid_privacy_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); } + org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -210,7 +289,7 @@ public class ChannelHandshakeConfig extends CommonBase { long ret = bindings.ChannelHandshakeConfig_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); } + org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -221,7 +300,7 @@ public class ChannelHandshakeConfig extends CommonBase { public static ChannelHandshakeConfig with_default() { long ret = bindings.ChannelHandshakeConfig_default(); if (ret >= 0 && ret <= 4096) { return null; } - ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); } + org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java index ff9262de..03f164ee 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java @@ -31,7 +31,7 @@ public class ChannelHandshakeLimits extends CommonBase { } /** - * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so + * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * * Default value: 0. @@ -43,7 +43,7 @@ public class ChannelHandshakeLimits extends CommonBase { } /** - * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so + * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so * only applies to inbound channels. * * Default value: 0. @@ -54,6 +54,30 @@ public class ChannelHandshakeLimits extends CommonBase { Reference.reachabilityFence(val); } + /** + * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so + * only applies to inbound channels. + * + * Default value: 2^24 - 1. + */ + public long get_max_funding_satoshis() { + long ret = bindings.ChannelHandshakeLimits_get_max_funding_satoshis(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so + * only applies to inbound channels. + * + * Default value: 2^24 - 1. + */ + public void set_max_funding_satoshis(long val) { + bindings.ChannelHandshakeLimits_set_max_funding_satoshis(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows * you to limit the maximum minimum-size they can require. @@ -180,6 +204,56 @@ public class ChannelHandshakeLimits extends CommonBase { Reference.reachabilityFence(val); } + /** + * Whether we implicitly trust funding transactions generated by us for our own outbound + * channels to not be double-spent. + * + * If this is set, we assume that our own funding transactions are *never* double-spent, and + * thus we can trust them without any confirmations. This is generally a reasonable + * assumption, given we're the only ones who could ever double-spend it (assuming we have sole + * control of the signing keys). + * + * You may wish to un-set this if you allow the user to (or do in an automated fashion) + * double-spend the funding transaction to RBF with an alternative channel open. + * + * This only applies if our counterparty set their confirmations-required value to 0, and we + * always trust our own funding transaction at 1 confirmation irrespective of this value. + * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being + * `true` (0) and `false` (1). + * + * Default value: true + */ + public boolean get_trust_own_funding_0conf() { + boolean ret = bindings.ChannelHandshakeLimits_get_trust_own_funding_0conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Whether we implicitly trust funding transactions generated by us for our own outbound + * channels to not be double-spent. + * + * If this is set, we assume that our own funding transactions are *never* double-spent, and + * thus we can trust them without any confirmations. This is generally a reasonable + * assumption, given we're the only ones who could ever double-spend it (assuming we have sole + * control of the signing keys). + * + * You may wish to un-set this if you allow the user to (or do in an automated fashion) + * double-spend the funding transaction to RBF with an alternative channel open. + * + * This only applies if our counterparty set their confirmations-required value to 0, and we + * always trust our own funding transaction at 1 confirmation irrespective of this value. + * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being + * `true` (0) and `false` (1). + * + * Default value: true + */ + public void set_trust_own_funding_0conf(boolean val) { + bindings.ChannelHandshakeLimits_set_trust_own_funding_0conf(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Set to force an incoming channel to match our announced channel preference in * [`ChannelConfig::announced_channel`]. @@ -245,18 +319,20 @@ public class ChannelHandshakeLimits extends CommonBase { /** * Constructs a new ChannelHandshakeLimits given each field */ - public static ChannelHandshakeLimits of(long min_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, int max_minimum_depth_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg) { - long ret = bindings.ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); + public static ChannelHandshakeLimits of(long min_funding_satoshis_arg, long max_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, int max_minimum_depth_arg, boolean trust_own_funding_0conf_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg) { + long ret = bindings.ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); Reference.reachabilityFence(min_funding_satoshis_arg); + Reference.reachabilityFence(max_funding_satoshis_arg); Reference.reachabilityFence(max_htlc_minimum_msat_arg); Reference.reachabilityFence(min_max_htlc_value_in_flight_msat_arg); Reference.reachabilityFence(max_channel_reserve_satoshis_arg); Reference.reachabilityFence(min_max_accepted_htlcs_arg); Reference.reachabilityFence(max_minimum_depth_arg); + Reference.reachabilityFence(trust_own_funding_0conf_arg); Reference.reachabilityFence(force_announced_channel_preference_arg); Reference.reachabilityFence(their_to_self_delay_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeLimits(null, ret); } + org.ldk.structs.ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeLimits(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -274,7 +350,7 @@ public class ChannelHandshakeLimits extends CommonBase { long ret = bindings.ChannelHandshakeLimits_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeLimits(null, ret); } + org.ldk.structs.ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeLimits(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -285,7 +361,7 @@ public class ChannelHandshakeLimits extends CommonBase { public static ChannelHandshakeLimits with_default() { long ret = bindings.ChannelHandshakeLimits_default(); if (ret >= 0 && ret <= 4096) { return null; } - ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeLimits(null, ret); } + org.ldk.structs.ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeLimits(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index aad7e4c0..fa2ca7cf 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -28,7 +28,7 @@ public class ChannelInfo extends CommonBase { long ret = bindings.ChannelInfo_get_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); } + org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -49,7 +49,7 @@ public class ChannelInfo extends CommonBase { long ret = bindings.ChannelInfo_get_node_one(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -73,7 +73,7 @@ public class ChannelInfo extends CommonBase { long ret = bindings.ChannelInfo_get_one_to_two(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdateInfo(null, ret); } + org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -96,7 +96,7 @@ public class ChannelInfo extends CommonBase { long ret = bindings.ChannelInfo_get_node_two(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -120,7 +120,7 @@ public class ChannelInfo extends CommonBase { long ret = bindings.ChannelInfo_get_two_to_one(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdateInfo(null, ret); } + org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -170,7 +170,7 @@ public class ChannelInfo extends CommonBase { long ret = bindings.ChannelInfo_get_announcement_message(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); } + org.ldk.structs.ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -202,7 +202,23 @@ public class ChannelInfo extends CommonBase { long ret = bindings.ChannelInfo_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelInfo(null, ret); } + org.ldk.structs.ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelInfo(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable + public ChannelUpdateInfo get_directional_info(byte channel_flags) { + long ret = bindings.ChannelInfo_get_directional_info(this.ptr, channel_flags); + Reference.reachabilityFence(this); + Reference.reachabilityFence(channel_flags); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index ea569eb0..c385abf6 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -63,8 +63,6 @@ public class ChannelManager extends CommonBase { * * Non-proportional fees are fixed according to our risk using the provided fee estimator. * - * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`! - * * Users need to notify the new ChannelManager when a new block is connected or * disconnected using its `block_connected` and `block_disconnected` methods, starting * from after `params.latest_hash`. @@ -79,7 +77,7 @@ public class ChannelManager extends CommonBase { Reference.reachabilityFence(config); Reference.reachabilityFence(params); if (ret >= 0 && ret <= 4096) { return null; } - ChannelManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelManager(null, ret); } + org.ldk.structs.ChannelManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelManager(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(fee_est); ret_hu_conv.ptrs_to.add(chain_monitor); @@ -96,7 +94,7 @@ public class ChannelManager extends CommonBase { long ret = bindings.ChannelManager_get_current_default_configuration(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); } + org.ldk.structs.UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UserConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -155,7 +153,7 @@ public class ChannelManager extends CommonBase { ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret_conv_16_len]; for (int q = 0; q < ret_conv_16_len; q++) { long ret_conv_16 = ret[q]; - ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16); } + org.ldk.structs.ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, ret_conv_16); } ret_conv_16_hu_conv.ptrs_to.add(this); ret_conv_16_arr[q] = ret_conv_16_hu_conv; } @@ -163,12 +161,14 @@ public class ChannelManager extends CommonBase { } /** - * Gets the list of usable channels, in random order. Useful as an argument to - * get_route to ensure non-announced channels are used. + * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`] + * to ensure non-announced channels are used. * * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria * are. + * + * [`find_route`]: crate::routing::router::find_route */ public ChannelDetails[] list_usable_channels() { long[] ret = bindings.ChannelManager_list_usable_channels(this.ptr); @@ -177,7 +177,7 @@ public class ChannelManager extends CommonBase { ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret_conv_16_len]; for (int q = 0; q < ret_conv_16_len; q++) { long ret_conv_16 = ret[q]; - ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16); } + org.ldk.structs.ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, ret_conv_16); } ret_conv_16_hu_conv.ptrs_to.add(this); ret_conv_16_arr[q] = ret_conv_16_hu_conv; } @@ -203,10 +203,11 @@ public class ChannelManager extends CommonBase { * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal */ - public Result_NoneAPIErrorZ close_channel(byte[] channel_id) { - long ret = bindings.ChannelManager_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32)); + public Result_NoneAPIErrorZ close_channel(byte[] channel_id, byte[] counterparty_node_id) { + long ret = bindings.ChannelManager_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33)); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_id); + Reference.reachabilityFence(counterparty_node_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -233,10 +234,11 @@ public class ChannelManager extends CommonBase { * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal */ - public Result_NoneAPIErrorZ close_channel_with_target_feerate(byte[] channel_id, int target_feerate_sats_per_1000_weight) { - long ret = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, InternalUtils.check_arr_len(channel_id, 32), target_feerate_sats_per_1000_weight); + public Result_NoneAPIErrorZ close_channel_with_target_feerate(byte[] channel_id, byte[] counterparty_node_id, int target_feerate_sats_per_1000_weight) { + long ret = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, InternalUtils.check_arr_len(channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), target_feerate_sats_per_1000_weight); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_id); + Reference.reachabilityFence(counterparty_node_id); Reference.reachabilityFence(target_feerate_sats_per_1000_weight); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); @@ -245,12 +247,15 @@ public class ChannelManager extends CommonBase { /** * Force closes a channel, immediately broadcasting the latest local commitment transaction to - * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager. + * the chain and rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to + * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding + * channel. */ - public Result_NoneAPIErrorZ force_close_channel(byte[] channel_id) { - long ret = bindings.ChannelManager_force_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32)); + public Result_NoneAPIErrorZ force_close_channel(byte[] channel_id, byte[] counterparty_node_id) { + long ret = bindings.ChannelManager_force_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33)); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_id); + Reference.reachabilityFence(counterparty_node_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; @@ -418,10 +423,11 @@ public class ChannelManager extends CommonBase { * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed */ - public Result_NoneAPIErrorZ funding_transaction_generated(byte[] temporary_channel_id, byte[] funding_transaction) { - long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, InternalUtils.check_arr_len(temporary_channel_id, 32), funding_transaction); + public Result_NoneAPIErrorZ funding_transaction_generated(byte[] temporary_channel_id, byte[] counterparty_node_id, byte[] funding_transaction) { + long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, InternalUtils.check_arr_len(temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), funding_transaction); Reference.reachabilityFence(this); Reference.reachabilityFence(temporary_channel_id); + Reference.reachabilityFence(counterparty_node_id); Reference.reachabilityFence(funding_transaction); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); @@ -488,38 +494,47 @@ public class ChannelManager extends CommonBase { * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources * along the path (including in our own channel on which we received it). - * Returns false if no payment was found to fail backwards, true if the process of failing the - * HTLC backwards has been started. + * + * Note that in some cases around unclean shutdown, it is possible the payment may have + * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a + * second copy of) the [`events::Event::PaymentReceived`] event. Alternatively, the payment + * may have already been failed automatically by LDK if it was nearing its expiration time. + * + * While LDK will never claim a payment automatically on your behalf (i.e. without you calling + * [`ChannelManager::claim_funds`]), you should still monitor for + * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on + * startup during which time claims that were in-progress at shutdown may be replayed. */ - public boolean fail_htlc_backwards(byte[] payment_hash) { - boolean ret = bindings.ChannelManager_fail_htlc_backwards(this.ptr, InternalUtils.check_arr_len(payment_hash, 32)); + public void fail_htlc_backwards(byte[] payment_hash) { + bindings.ChannelManager_fail_htlc_backwards(this.ptr, InternalUtils.check_arr_len(payment_hash, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_hash); - return ret; } /** * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any * [`MessageSendEvent`]s needed to claim the payment. * + * Note that calling this method does *not* guarantee that the payment has been claimed. You + * must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be + * provided to your [`EventHandler`] when [`process_pending_events`] is next called. + * * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived` * event matches your expectation. If you fail to do so and call this method, you may provide * the sender \"proof-of-payment\" when they did not fulfill the full expected payment. * - * Returns whether any HTLCs were claimed, and thus if any new [`MessageSendEvent`]s are now - * pending for processing via [`get_and_clear_pending_msg_events`]. - * * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived + * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed + * [`process_pending_events`]: EventsProvider::process_pending_events * [`create_inbound_payment`]: Self::create_inbound_payment * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events */ - public boolean claim_funds(byte[] payment_preimage) { - boolean ret = bindings.ChannelManager_claim_funds(this.ptr, InternalUtils.check_arr_len(payment_preimage, 32)); + public void claim_funds(byte[] payment_preimage) { + bindings.ChannelManager_claim_funds(this.ptr, InternalUtils.check_arr_len(payment_preimage, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_preimage); - return ret; } /** @@ -532,22 +547,59 @@ public class ChannelManager extends CommonBase { } /** - * Called to accept a request to open a channel after [`Event::OpenChannelRequest`] has been - * triggered. + * Accepts a request to open a channel after a [`Event::OpenChannelRequest`]. + * + * The `temporary_channel_id` parameter indicates which inbound channel should be accepted, + * and the `counterparty_node_id` parameter is the id of the peer which has requested to open + * the channel. * - * The `temporary_channel_id` parameter indicates which inbound channel should be accepted. + * The `user_channel_id` parameter will be provided back in + * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond + * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call. + * + * Note that this method will return an error and reject the channel, if it requires support + * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be + * used to accept such channels. + * + * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest + * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id + */ + public Result_NoneAPIErrorZ accept_inbound_channel(byte[] temporary_channel_id, byte[] counterparty_node_id, long user_channel_id) { + long ret = bindings.ChannelManager_accept_inbound_channel(this.ptr, InternalUtils.check_arr_len(temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), user_channel_id); + Reference.reachabilityFence(this); + Reference.reachabilityFence(temporary_channel_id); + Reference.reachabilityFence(counterparty_node_id); + Reference.reachabilityFence(user_channel_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating + * it as confirmed immediately. * - * For inbound channels, the `user_channel_id` parameter will be provided back in + * The `user_channel_id` parameter will be provided back in * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond - * with which `accept_inbound_channel` call. + * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call. + * + * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel + * and (if the counterparty agrees), enables forwarding of payments immediately. + * + * This fully trusts that the counterparty has honestly and correctly constructed the funding + * transaction and blindly assumes that it will eventually confirm. + * + * If it does not confirm before we decide to close the channel, or if the funding transaction + * does not pay to the correct script the correct amount, *you will lose funds*. * * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id */ - public Result_NoneAPIErrorZ accept_inbound_channel(byte[] temporary_channel_id, long user_channel_id) { - long ret = bindings.ChannelManager_accept_inbound_channel(this.ptr, InternalUtils.check_arr_len(temporary_channel_id, 32), user_channel_id); + public Result_NoneAPIErrorZ accept_inbound_channel_from_trusted_peer_0conf(byte[] temporary_channel_id, byte[] counterparty_node_id, long user_channel_id) { + long ret = bindings.ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(this.ptr, InternalUtils.check_arr_len(temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), user_channel_id); Reference.reachabilityFence(this); Reference.reachabilityFence(temporary_channel_id); + Reference.reachabilityFence(counterparty_node_id); Reference.reachabilityFence(user_channel_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); @@ -728,7 +780,7 @@ public class ChannelManager extends CommonBase { long ret = bindings.ChannelManager_get_phantom_route_hints(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PhantomRouteHints(null, ret); } + org.ldk.structs.PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PhantomRouteHints(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -818,7 +870,7 @@ public class ChannelManager extends CommonBase { long ret = bindings.ChannelManager_current_best_block(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java index a0a628e8..f8b3d6fa 100644 --- a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java +++ b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java @@ -191,7 +191,7 @@ public class ChannelManagerReadArgs extends CommonBase { long ret = bindings.ChannelManagerReadArgs_get_default_config(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); } + org.ldk.structs.UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UserConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -221,7 +221,7 @@ public class ChannelManagerReadArgs extends CommonBase { Reference.reachabilityFence(default_config); Reference.reachabilityFence(channel_monitors); if (ret >= 0 && ret <= 4096) { return null; } - ChannelManagerReadArgs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelManagerReadArgs(null, ret); } + org.ldk.structs.ChannelManagerReadArgs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelManagerReadArgs(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(keys_manager); ret_hu_conv.ptrs_to.add(fee_estimator); diff --git a/src/main/java/org/ldk/structs/ChannelMessageHandler.java b/src/main/java/org/ldk/structs/ChannelMessageHandler.java index 50da70d6..71acdd9a 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -46,9 +46,9 @@ public class ChannelMessageHandler extends CommonBase { */ void handle_funding_signed(byte[] their_node_id, FundingSigned msg); /** - * Handle an incoming funding_locked message from the given peer. + * Handle an incoming channel_ready message from the given peer. */ - void handle_funding_locked(byte[] their_node_id, FundingLocked msg); + void handle_channel_ready(byte[] their_node_id, ChannelReady msg); /** * Handle an incoming shutdown message from the given peer. */ @@ -118,82 +118,82 @@ public class ChannelMessageHandler extends CommonBase { final LDKChannelMessageHandlerHolder impl_holder = new LDKChannelMessageHandlerHolder(); impl_holder.held = new ChannelMessageHandler(new bindings.LDKChannelMessageHandler() { @Override public void handle_open_channel(byte[] their_node_id, long their_features, long msg) { - InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new InitFeatures(null, their_features); } + org.ldk.structs.InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new org.ldk.structs.InitFeatures(null, their_features); } their_features_hu_conv.ptrs_to.add(this); - OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new OpenChannel(null, msg); } + org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); } arg.handle_open_channel(their_node_id, their_features_hu_conv, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_accept_channel(byte[] their_node_id, long their_features, long msg) { - InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new InitFeatures(null, their_features); } + org.ldk.structs.InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new org.ldk.structs.InitFeatures(null, their_features); } their_features_hu_conv.ptrs_to.add(this); - AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AcceptChannel(null, msg); } + org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); } arg.handle_accept_channel(their_node_id, their_features_hu_conv, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_funding_created(byte[] their_node_id, long msg) { - FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingCreated(null, msg); } + org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); } arg.handle_funding_created(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_funding_signed(byte[] their_node_id, long msg) { - FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingSigned(null, msg); } + org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); } arg.handle_funding_signed(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } - @Override public void handle_funding_locked(byte[] their_node_id, long msg) { - FundingLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingLocked(null, msg); } - arg.handle_funding_locked(their_node_id, msg_hu_conv); + @Override public void handle_channel_ready(byte[] their_node_id, long msg) { + org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); } + arg.handle_channel_ready(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_shutdown(byte[] their_node_id, long their_features, long msg) { - InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new InitFeatures(null, their_features); } - Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Shutdown(null, msg); } + org.ldk.structs.InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new org.ldk.structs.InitFeatures(null, their_features); } + org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); } arg.handle_shutdown(their_node_id, their_features_hu_conv, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_closing_signed(byte[] their_node_id, long msg) { - ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ClosingSigned(null, msg); } + org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); } arg.handle_closing_signed(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_update_add_htlc(byte[] their_node_id, long msg) { - UpdateAddHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateAddHTLC(null, msg); } + org.ldk.structs.UpdateAddHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateAddHTLC(null, msg); } arg.handle_update_add_htlc(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_update_fulfill_htlc(byte[] their_node_id, long msg) { - UpdateFulfillHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFulfillHTLC(null, msg); } + org.ldk.structs.UpdateFulfillHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateFulfillHTLC(null, msg); } arg.handle_update_fulfill_htlc(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_update_fail_htlc(byte[] their_node_id, long msg) { - UpdateFailHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFailHTLC(null, msg); } + org.ldk.structs.UpdateFailHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateFailHTLC(null, msg); } arg.handle_update_fail_htlc(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_update_fail_malformed_htlc(byte[] their_node_id, long msg) { - UpdateFailMalformedHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFailMalformedHTLC(null, msg); } + org.ldk.structs.UpdateFailMalformedHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateFailMalformedHTLC(null, msg); } arg.handle_update_fail_malformed_htlc(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_commitment_signed(byte[] their_node_id, long msg) { - CommitmentSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new CommitmentSigned(null, msg); } + org.ldk.structs.CommitmentSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.CommitmentSigned(null, msg); } arg.handle_commitment_signed(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_revoke_and_ack(byte[] their_node_id, long msg) { - RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new RevokeAndACK(null, msg); } + org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); } arg.handle_revoke_and_ack(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_update_fee(byte[] their_node_id, long msg) { - UpdateFee msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFee(null, msg); } + org.ldk.structs.UpdateFee msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateFee(null, msg); } arg.handle_update_fee(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_announcement_signatures(byte[] their_node_id, long msg) { - AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AnnouncementSignatures(null, msg); } + org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); } arg.handle_announcement_signatures(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @@ -202,22 +202,22 @@ public class ChannelMessageHandler extends CommonBase { Reference.reachabilityFence(arg); } @Override public void peer_connected(byte[] their_node_id, long msg) { - Init msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Init(null, msg); } + org.ldk.structs.Init msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Init(null, msg); } arg.peer_connected(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_channel_reestablish(byte[] their_node_id, long msg) { - ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelReestablish(null, msg); } + org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); } arg.handle_channel_reestablish(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_channel_update(byte[] their_node_id, long msg) { - ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); } + org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); } arg.handle_channel_update(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @Override public void handle_error(byte[] their_node_id, long msg) { - ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ErrorMessage(null, msg); } + org.ldk.structs.ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ErrorMessage(null, msg); } arg.handle_error(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); } @@ -281,10 +281,10 @@ public class ChannelMessageHandler extends CommonBase { } /** - * Handle an incoming funding_locked message from the given peer. + * Handle an incoming channel_ready message from the given peer. */ - public void handle_funding_locked(byte[] their_node_id, FundingLocked msg) { - bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); + public void handle_channel_ready(byte[] their_node_id, ChannelReady msg) { + bindings.ChannelMessageHandler_handle_channel_ready(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); Reference.reachabilityFence(msg); diff --git a/src/main/java/org/ldk/structs/ChannelMonitor.java b/src/main/java/org/ldk/structs/ChannelMonitor.java index ff48891e..ceb03172 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitor.java +++ b/src/main/java/org/ldk/structs/ChannelMonitor.java @@ -48,7 +48,7 @@ public class ChannelMonitor extends CommonBase { long ret = bindings.ChannelMonitor_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelMonitor(null, ret); } + org.ldk.structs.ChannelMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelMonitor(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -348,7 +348,7 @@ public class ChannelMonitor extends CommonBase { long ret = bindings.ChannelMonitor_current_best_block(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } ret_hu_conv.ptrs_to.add(this); 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 c221d105..d898f862 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java @@ -72,7 +72,7 @@ public class ChannelMonitorUpdate extends CommonBase { long ret = bindings.ChannelMonitorUpdate_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelMonitorUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelMonitorUpdate(null, ret); } + org.ldk.structs.ChannelMonitorUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelPublicKeys.java b/src/main/java/org/ldk/structs/ChannelPublicKeys.java index ce8eec40..8523ade9 100644 --- a/src/main/java/org/ldk/structs/ChannelPublicKeys.java +++ b/src/main/java/org/ldk/structs/ChannelPublicKeys.java @@ -139,7 +139,7 @@ public class ChannelPublicKeys extends CommonBase { Reference.reachabilityFence(delayed_payment_basepoint_arg); Reference.reachabilityFence(htlc_basepoint_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } + org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -157,7 +157,7 @@ public class ChannelPublicKeys extends CommonBase { long ret = bindings.ChannelPublicKeys_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } + org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/FundingLocked.java b/src/main/java/org/ldk/structs/ChannelReady.java similarity index 56% rename from src/main/java/org/ldk/structs/FundingLocked.java rename to src/main/java/org/ldk/structs/ChannelReady.java index 924a31fa..fb231669 100644 --- a/src/main/java/org/ldk/structs/FundingLocked.java +++ b/src/main/java/org/ldk/structs/ChannelReady.java @@ -9,22 +9,22 @@ import javax.annotation.Nullable; /** - * A funding_locked message to be sent or received from a peer + * A channel_ready message to be sent or received from a peer */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class FundingLocked extends CommonBase { - FundingLocked(Object _dummy, long ptr) { super(ptr); } +public class ChannelReady extends CommonBase { + ChannelReady(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - if (ptr != 0) { bindings.FundingLocked_free(ptr); } + if (ptr != 0) { bindings.ChannelReady_free(ptr); } } /** * The channel ID */ public byte[] get_channel_id() { - byte[] ret = bindings.FundingLocked_get_channel_id(this.ptr); + byte[] ret = bindings.ChannelReady_get_channel_id(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -33,7 +33,7 @@ public class FundingLocked extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.FundingLocked_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + bindings.ChannelReady_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } @@ -42,7 +42,7 @@ public class FundingLocked extends CommonBase { * The per-commitment point of the second commitment transaction */ public byte[] get_next_per_commitment_point() { - byte[] ret = bindings.FundingLocked_get_next_per_commitment_point(this.ptr); + byte[] ret = bindings.ChannelReady_get_next_per_commitment_point(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -51,7 +51,7 @@ public class FundingLocked extends CommonBase { * The per-commitment point of the second commitment transaction */ public void set_next_per_commitment_point(byte[] val) { - bindings.FundingLocked_set_next_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + bindings.ChannelReady_set_next_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } @@ -61,7 +61,7 @@ public class FundingLocked extends CommonBase { * to be forwarded over this SCID and forward them to this messages' recipient. */ public Option_u64Z get_short_channel_id_alias() { - long ret = bindings.FundingLocked_get_short_channel_id_alias(this.ptr); + long ret = bindings.ChannelReady_get_short_channel_id_alias(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); @@ -74,60 +74,60 @@ public class FundingLocked extends CommonBase { * to be forwarded over this SCID and forward them to this messages' recipient. */ public void set_short_channel_id_alias(Option_u64Z val) { - bindings.FundingLocked_set_short_channel_id_alias(this.ptr, val.ptr); + bindings.ChannelReady_set_short_channel_id_alias(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * Constructs a new FundingLocked given each field + * Constructs a new ChannelReady given each field */ - public static FundingLocked of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg, Option_u64Z short_channel_id_alias_arg) { - long ret = bindings.FundingLocked_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33), short_channel_id_alias_arg.ptr); + public static ChannelReady of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg, Option_u64Z short_channel_id_alias_arg) { + long ret = bindings.ChannelReady_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33), short_channel_id_alias_arg.ptr); Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(next_per_commitment_point_arg); Reference.reachabilityFence(short_channel_id_alias_arg); if (ret >= 0 && ret <= 4096) { return null; } - FundingLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingLocked(null, ret); } + org.ldk.structs.ChannelReady ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReady(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } long clone_ptr() { - long ret = bindings.FundingLocked_clone_ptr(this.ptr); + long ret = bindings.ChannelReady_clone_ptr(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * Creates a copy of the FundingLocked + * Creates a copy of the ChannelReady */ - public FundingLocked clone() { - long ret = bindings.FundingLocked_clone(this.ptr); + public ChannelReady clone() { + long ret = bindings.ChannelReady_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - FundingLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingLocked(null, ret); } + org.ldk.structs.ChannelReady ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReady(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } /** - * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read + * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read */ public byte[] write() { - byte[] ret = bindings.FundingLocked_write(this.ptr); + byte[] ret = bindings.ChannelReady_write(this.ptr); Reference.reachabilityFence(this); return ret; } /** - * Read a FundingLocked from a byte array, created by FundingLocked_write + * Read a ChannelReady from a byte array, created by ChannelReady_write */ - public static Result_FundingLockedDecodeErrorZ read(byte[] ser) { - long ret = bindings.FundingLocked_read(ser); + public static Result_ChannelReadyDecodeErrorZ read(byte[] ser) { + long ret = bindings.ChannelReady_read(ser); Reference.reachabilityFence(ser); if (ret >= 0 && ret <= 4096) { return null; } - Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); + Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelReestablish.java b/src/main/java/org/ldk/structs/ChannelReestablish.java index 47f38226..b5492388 100644 --- a/src/main/java/org/ldk/structs/ChannelReestablish.java +++ b/src/main/java/org/ldk/structs/ChannelReestablish.java @@ -87,7 +87,7 @@ public class ChannelReestablish extends CommonBase { long ret = bindings.ChannelReestablish_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelReestablish(null, ret); } + org.ldk.structs.ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReestablish(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java index 2bc34609..587614ae 100644 --- a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java @@ -31,7 +31,7 @@ public class ChannelTransactionParameters extends CommonBase { long ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } + org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -94,7 +94,7 @@ public class ChannelTransactionParameters extends CommonBase { long ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); } + org.ldk.structs.CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyChannelTransactionParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -121,7 +121,7 @@ public class ChannelTransactionParameters extends CommonBase { long ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -167,7 +167,7 @@ public class ChannelTransactionParameters extends CommonBase { Reference.reachabilityFence(funding_outpoint_arg); Reference.reachabilityFence(opt_anchors_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTransactionParameters(null, ret); } + org.ldk.structs.ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -185,7 +185,7 @@ public class ChannelTransactionParameters extends CommonBase { long ret = bindings.ChannelTransactionParameters_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTransactionParameters(null, ret); } + org.ldk.structs.ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -209,7 +209,7 @@ public class ChannelTransactionParameters extends CommonBase { long ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - DirectedChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); } + org.ldk.structs.DirectedChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DirectedChannelTransactionParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -224,7 +224,7 @@ public class ChannelTransactionParameters extends CommonBase { long ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - DirectedChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); } + org.ldk.structs.DirectedChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DirectedChannelTransactionParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelTypeFeatures.java b/src/main/java/org/ldk/structs/ChannelTypeFeatures.java index 0dcfcf53..b827618a 100644 --- a/src/main/java/org/ldk/structs/ChannelTypeFeatures.java +++ b/src/main/java/org/ldk/structs/ChannelTypeFeatures.java @@ -59,7 +59,7 @@ public class ChannelTypeFeatures extends CommonBase { long ret = bindings.ChannelTypeFeatures_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -70,7 +70,7 @@ public class ChannelTypeFeatures extends CommonBase { public static ChannelTypeFeatures empty() { long ret = bindings.ChannelTypeFeatures_empty(); if (ret >= 0 && ret <= 4096) { return null; } - ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -81,7 +81,7 @@ public class ChannelTypeFeatures extends CommonBase { public static ChannelTypeFeatures known() { long ret = bindings.ChannelTypeFeatures_known(); if (ret >= 0 && ret <= 4096) { return null; } - ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -116,4 +116,106 @@ public class ChannelTypeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Set this feature as optional. + */ + public void set_static_remote_key_optional() { + bindings.ChannelTypeFeatures_set_static_remote_key_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_static_remote_key_required() { + bindings.ChannelTypeFeatures_set_static_remote_key_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_static_remote_key() { + boolean ret = bindings.ChannelTypeFeatures_supports_static_remote_key(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_static_remote_key() { + boolean ret = bindings.ChannelTypeFeatures_requires_static_remote_key(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_scid_privacy_optional() { + bindings.ChannelTypeFeatures_set_scid_privacy_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_scid_privacy_required() { + bindings.ChannelTypeFeatures_set_scid_privacy_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_scid_privacy() { + boolean ret = bindings.ChannelTypeFeatures_supports_scid_privacy(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_scid_privacy() { + boolean ret = bindings.ChannelTypeFeatures_requires_scid_privacy(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_zero_conf_optional() { + bindings.ChannelTypeFeatures_set_zero_conf_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_zero_conf_required() { + bindings.ChannelTypeFeatures_set_zero_conf_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_zero_conf() { + boolean ret = bindings.ChannelTypeFeatures_supports_zero_conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_zero_conf() { + boolean ret = bindings.ChannelTypeFeatures_requires_zero_conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/ChannelUpdate.java b/src/main/java/org/ldk/structs/ChannelUpdate.java index a4f68b96..438fc62e 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelUpdate.java @@ -45,7 +45,7 @@ public class ChannelUpdate extends CommonBase { long ret = bindings.ChannelUpdate_get_contents(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelUpdate(null, ret); } + org.ldk.structs.UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -67,7 +67,7 @@ public class ChannelUpdate extends CommonBase { Reference.reachabilityFence(signature_arg); Reference.reachabilityFence(contents_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); } + org.ldk.structs.ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdate(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -85,7 +85,7 @@ public class ChannelUpdate extends CommonBase { long ret = bindings.ChannelUpdate_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); } + org.ldk.structs.ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelUpdateInfo.java b/src/main/java/org/ldk/structs/ChannelUpdateInfo.java index a6f51a13..04890882 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdateInfo.java +++ b/src/main/java/org/ldk/structs/ChannelUpdateInfo.java @@ -122,7 +122,7 @@ public class ChannelUpdateInfo extends CommonBase { long ret = bindings.ChannelUpdateInfo_get_fees(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); } + org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -149,7 +149,7 @@ public class ChannelUpdateInfo extends CommonBase { long ret = bindings.ChannelUpdateInfo_get_last_update_message(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); } + org.ldk.structs.ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -181,7 +181,7 @@ public class ChannelUpdateInfo extends CommonBase { Reference.reachabilityFence(fees_arg); Reference.reachabilityFence(last_update_message_arg); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdateInfo(null, ret); } + org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -199,7 +199,7 @@ public class ChannelUpdateInfo extends CommonBase { long ret = bindings.ChannelUpdateInfo_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdateInfo(null, ret); } + org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ChannelUsage.java b/src/main/java/org/ldk/structs/ChannelUsage.java new file mode 100644 index 00000000..805e7a0d --- /dev/null +++ b/src/main/java/org/ldk/structs/ChannelUsage.java @@ -0,0 +1,114 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`]. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class ChannelUsage extends CommonBase { + ChannelUsage(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.ChannelUsage_free(ptr); } + } + + /** + * The amount to send through the channel, denominated in millisatoshis. + */ + public long get_amount_msat() { + long ret = bindings.ChannelUsage_get_amount_msat(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * The amount to send through the channel, denominated in millisatoshis. + */ + public void set_amount_msat(long val) { + bindings.ChannelUsage_set_amount_msat(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Total amount, denominated in millisatoshis, already allocated to send through the channel + * as part of a multi-path payment. + */ + public long get_inflight_htlc_msat() { + long ret = bindings.ChannelUsage_get_inflight_htlc_msat(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Total amount, denominated in millisatoshis, already allocated to send through the channel + * as part of a multi-path payment. + */ + public void set_inflight_htlc_msat(long val) { + bindings.ChannelUsage_set_inflight_htlc_msat(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * The effective capacity of the channel. + */ + public EffectiveCapacity get_effective_capacity() { + long ret = bindings.ChannelUsage_get_effective_capacity(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The effective capacity of the channel. + */ + public void set_effective_capacity(EffectiveCapacity val) { + bindings.ChannelUsage_set_effective_capacity(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new ChannelUsage given each field + */ + public static ChannelUsage of(long amount_msat_arg, long inflight_htlc_msat_arg, EffectiveCapacity effective_capacity_arg) { + long ret = bindings.ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg.ptr); + Reference.reachabilityFence(amount_msat_arg); + Reference.reachabilityFence(inflight_htlc_msat_arg); + Reference.reachabilityFence(effective_capacity_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelUsage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUsage(null, ret); } + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.ChannelUsage_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the ChannelUsage + */ + public ChannelUsage clone() { + long ret = bindings.ChannelUsage_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelUsage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUsage(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/ClosingSigned.java b/src/main/java/org/ldk/structs/ClosingSigned.java index 8f4823fc..e1544b2a 100644 --- a/src/main/java/org/ldk/structs/ClosingSigned.java +++ b/src/main/java/org/ldk/structs/ClosingSigned.java @@ -85,7 +85,7 @@ public class ClosingSigned extends CommonBase { long ret = bindings.ClosingSigned_get_fee_range(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSignedFeeRange(null, ret); } + org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -112,7 +112,7 @@ public class ClosingSigned extends CommonBase { Reference.reachabilityFence(signature_arg); Reference.reachabilityFence(fee_range_arg); if (ret >= 0 && ret <= 4096) { return null; } - ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSigned(null, ret); } + org.ldk.structs.ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSigned(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -130,7 +130,7 @@ public class ClosingSigned extends CommonBase { long ret = bindings.ClosingSigned_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSigned(null, ret); } + org.ldk.structs.ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSigned(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java b/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java index b8f77a9b..eec3c22d 100644 --- a/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java +++ b/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java @@ -70,7 +70,7 @@ public class ClosingSignedFeeRange extends CommonBase { Reference.reachabilityFence(min_fee_satoshis_arg); Reference.reachabilityFence(max_fee_satoshis_arg); if (ret >= 0 && ret <= 4096) { return null; } - ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSignedFeeRange(null, ret); } + org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -88,7 +88,7 @@ public class ClosingSignedFeeRange extends CommonBase { long ret = bindings.ClosingSignedFeeRange_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSignedFeeRange(null, ret); } + org.ldk.structs.ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ClosingTransaction.java b/src/main/java/org/ldk/structs/ClosingTransaction.java index 8aba7dfd..dc7cf1dd 100644 --- a/src/main/java/org/ldk/structs/ClosingTransaction.java +++ b/src/main/java/org/ldk/structs/ClosingTransaction.java @@ -37,7 +37,7 @@ public class ClosingTransaction extends CommonBase { long ret = bindings.ClosingTransaction_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingTransaction(null, ret); } + org.ldk.structs.ClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingTransaction(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -65,7 +65,7 @@ public class ClosingTransaction extends CommonBase { Reference.reachabilityFence(to_counterparty_script); Reference.reachabilityFence(funding_outpoint); if (ret >= 0 && ret <= 4096) { return null; } - ClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingTransaction(null, ret); } + org.ldk.structs.ClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingTransaction(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -82,7 +82,7 @@ public class ClosingTransaction extends CommonBase { long ret = bindings.ClosingTransaction_trust(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - TrustedClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TrustedClosingTransaction(null, ret); } + org.ldk.structs.TrustedClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TrustedClosingTransaction(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ClosureReason.java b/src/main/java/org/ldk/structs/ClosureReason.java index 519ac61b..542c6ed7 100644 --- a/src/main/java/org/ldk/structs/ClosureReason.java +++ b/src/main/java/org/ldk/structs/ClosureReason.java @@ -119,11 +119,11 @@ public class ClosureReason extends CommonBase { } } /** - * The `PeerManager` informed us that we've disconnected from the peer. We close channels - * if the `PeerManager` informed us that it is unlikely we'll be able to connect to the - * peer again in the future or if the peer disconnected before we finished negotiating - * the channel open. The first case may be caused by incompatible features which our - * counterparty, or we, require. + * The peer disconnected prior to funding completing. In this case the spec mandates that we + * forget the channel entirely - we can attempt again if the peer reconnects. + * + * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the + * peer because of mutual incompatibility between us and our channel counterparty. */ public final static class DisconnectedPeer extends ClosureReason { private DisconnectedPeer(long ptr, bindings.LDKClosureReason.DisconnectedPeer obj) { diff --git a/src/main/java/org/ldk/structs/CommitmentSigned.java b/src/main/java/org/ldk/structs/CommitmentSigned.java index d9645922..69bcc987 100644 --- a/src/main/java/org/ldk/structs/CommitmentSigned.java +++ b/src/main/java/org/ldk/structs/CommitmentSigned.java @@ -74,7 +74,7 @@ public class CommitmentSigned extends CommonBase { Reference.reachabilityFence(signature_arg); Reference.reachabilityFence(htlc_signatures_arg); if (ret >= 0 && ret <= 4096) { return null; } - CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); } + org.ldk.structs.CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSigned(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -92,7 +92,7 @@ public class CommitmentSigned extends CommonBase { long ret = bindings.CommitmentSigned_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); } + org.ldk.structs.CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSigned(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CommitmentTransaction.java b/src/main/java/org/ldk/structs/CommitmentTransaction.java index 920975d3..7293fba1 100644 --- a/src/main/java/org/ldk/structs/CommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/CommitmentTransaction.java @@ -38,7 +38,7 @@ public class CommitmentTransaction extends CommonBase { long ret = bindings.CommitmentTransaction_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - CommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentTransaction(null, ret); } + org.ldk.structs.CommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentTransaction(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -111,7 +111,7 @@ public class CommitmentTransaction extends CommonBase { long ret = bindings.CommitmentTransaction_trust(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - TrustedCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TrustedCommitmentTransaction(null, ret); } + org.ldk.structs.TrustedCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TrustedCommitmentTransaction(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CommitmentUpdate.java b/src/main/java/org/ldk/structs/CommitmentUpdate.java index 8b726500..cfbbb703 100644 --- a/src/main/java/org/ldk/structs/CommitmentUpdate.java +++ b/src/main/java/org/ldk/structs/CommitmentUpdate.java @@ -31,7 +31,7 @@ public class CommitmentUpdate extends CommonBase { UpdateAddHTLC[] ret_conv_15_arr = new UpdateAddHTLC[ret_conv_15_len]; for (int p = 0; p < ret_conv_15_len; p++) { long ret_conv_15 = ret[p]; - UpdateAddHTLC ret_conv_15_hu_conv = null; if (ret_conv_15 < 0 || ret_conv_15 > 4096) { ret_conv_15_hu_conv = new UpdateAddHTLC(null, ret_conv_15); } + org.ldk.structs.UpdateAddHTLC ret_conv_15_hu_conv = null; if (ret_conv_15 < 0 || ret_conv_15 > 4096) { ret_conv_15_hu_conv = new org.ldk.structs.UpdateAddHTLC(null, ret_conv_15); } ret_conv_15_hu_conv.ptrs_to.add(this); ret_conv_15_arr[p] = ret_conv_15_hu_conv; } @@ -57,7 +57,7 @@ public class CommitmentUpdate extends CommonBase { UpdateFulfillHTLC[] ret_conv_19_arr = new UpdateFulfillHTLC[ret_conv_19_len]; for (int t = 0; t < ret_conv_19_len; t++) { long ret_conv_19 = ret[t]; - UpdateFulfillHTLC ret_conv_19_hu_conv = null; if (ret_conv_19 < 0 || ret_conv_19 > 4096) { ret_conv_19_hu_conv = new UpdateFulfillHTLC(null, ret_conv_19); } + org.ldk.structs.UpdateFulfillHTLC ret_conv_19_hu_conv = null; if (ret_conv_19 < 0 || ret_conv_19 > 4096) { ret_conv_19_hu_conv = new org.ldk.structs.UpdateFulfillHTLC(null, ret_conv_19); } ret_conv_19_hu_conv.ptrs_to.add(this); ret_conv_19_arr[t] = ret_conv_19_hu_conv; } @@ -83,7 +83,7 @@ public class CommitmentUpdate extends CommonBase { UpdateFailHTLC[] ret_conv_16_arr = new UpdateFailHTLC[ret_conv_16_len]; for (int q = 0; q < ret_conv_16_len; q++) { long ret_conv_16 = ret[q]; - UpdateFailHTLC ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new UpdateFailHTLC(null, ret_conv_16); } + org.ldk.structs.UpdateFailHTLC ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new org.ldk.structs.UpdateFailHTLC(null, ret_conv_16); } ret_conv_16_hu_conv.ptrs_to.add(this); ret_conv_16_arr[q] = ret_conv_16_hu_conv; } @@ -109,7 +109,7 @@ public class CommitmentUpdate extends CommonBase { UpdateFailMalformedHTLC[] ret_conv_25_arr = new UpdateFailMalformedHTLC[ret_conv_25_len]; for (int z = 0; z < ret_conv_25_len; z++) { long ret_conv_25 = ret[z]; - UpdateFailMalformedHTLC ret_conv_25_hu_conv = null; if (ret_conv_25 < 0 || ret_conv_25 > 4096) { ret_conv_25_hu_conv = new UpdateFailMalformedHTLC(null, ret_conv_25); } + org.ldk.structs.UpdateFailMalformedHTLC ret_conv_25_hu_conv = null; if (ret_conv_25 < 0 || ret_conv_25 > 4096) { ret_conv_25_hu_conv = new org.ldk.structs.UpdateFailMalformedHTLC(null, ret_conv_25); } ret_conv_25_hu_conv.ptrs_to.add(this); ret_conv_25_arr[z] = ret_conv_25_hu_conv; } @@ -135,7 +135,7 @@ public class CommitmentUpdate extends CommonBase { long ret = bindings.CommitmentUpdate_get_update_fee(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFee(null, ret); } + org.ldk.structs.UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFee(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -158,7 +158,7 @@ public class CommitmentUpdate extends CommonBase { long ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); } + org.ldk.structs.CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSigned(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -184,7 +184,7 @@ public class CommitmentUpdate extends CommonBase { Reference.reachabilityFence(update_fee_arg); Reference.reachabilityFence(commitment_signed_arg); if (ret >= 0 && ret <= 4096) { return null; } - CommitmentUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentUpdate(null, ret); } + org.ldk.structs.CommitmentUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentUpdate(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -202,7 +202,7 @@ public class CommitmentUpdate extends CommonBase { long ret = bindings.CommitmentUpdate_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - CommitmentUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentUpdate(null, ret); } + org.ldk.structs.CommitmentUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java index 94e7ee66..1b4c1e9d 100644 --- a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java @@ -27,7 +27,7 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { long ret = bindings.CounterpartyChannelTransactionParameters_get_pubkeys(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } + org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -67,7 +67,7 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { Reference.reachabilityFence(pubkeys_arg); Reference.reachabilityFence(selected_contest_delay_arg); if (ret >= 0 && ret <= 4096) { return null; } - CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); } + org.ldk.structs.CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyChannelTransactionParameters(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -85,7 +85,7 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { long ret = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); } + org.ldk.structs.CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyChannelTransactionParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CounterpartyCommitmentSecrets.java b/src/main/java/org/ldk/structs/CounterpartyCommitmentSecrets.java index 98bf7cd3..14ae4428 100644 --- a/src/main/java/org/ldk/structs/CounterpartyCommitmentSecrets.java +++ b/src/main/java/org/ldk/structs/CounterpartyCommitmentSecrets.java @@ -10,7 +10,7 @@ import javax.annotation.Nullable; /** * Implements the per-commitment secret storage scheme from - * [BOLT 3](https://github.com/lightningnetwork/lightning-rfc/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage). + * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage). * * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes * or so. @@ -37,7 +37,7 @@ public class CounterpartyCommitmentSecrets extends CommonBase { long ret = bindings.CounterpartyCommitmentSecrets_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - CounterpartyCommitmentSecrets ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyCommitmentSecrets(null, ret); } + org.ldk.structs.CounterpartyCommitmentSecrets ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyCommitmentSecrets(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -48,7 +48,7 @@ public class CounterpartyCommitmentSecrets extends CommonBase { public static CounterpartyCommitmentSecrets of() { long ret = bindings.CounterpartyCommitmentSecrets_new(); if (ret >= 0 && ret <= 4096) { return null; } - CounterpartyCommitmentSecrets ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyCommitmentSecrets(null, ret); } + org.ldk.structs.CounterpartyCommitmentSecrets ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyCommitmentSecrets(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/CounterpartyForwardingInfo.java b/src/main/java/org/ldk/structs/CounterpartyForwardingInfo.java index 405a51a2..c3b9bdb5 100644 --- a/src/main/java/org/ldk/structs/CounterpartyForwardingInfo.java +++ b/src/main/java/org/ldk/structs/CounterpartyForwardingInfo.java @@ -87,7 +87,7 @@ public class CounterpartyForwardingInfo extends CommonBase { Reference.reachabilityFence(fee_proportional_millionths_arg); Reference.reachabilityFence(cltv_expiry_delta_arg); if (ret >= 0 && ret <= 4096) { return null; } - CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyForwardingInfo(null, ret); } + org.ldk.structs.CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyForwardingInfo(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -105,7 +105,7 @@ public class CounterpartyForwardingInfo extends CommonBase { long ret = bindings.CounterpartyForwardingInfo_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyForwardingInfo(null, ret); } + org.ldk.structs.CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyForwardingInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/DataLossProtect.java b/src/main/java/org/ldk/structs/DataLossProtect.java index d316e5f3..28d13741 100644 --- a/src/main/java/org/ldk/structs/DataLossProtect.java +++ b/src/main/java/org/ldk/structs/DataLossProtect.java @@ -69,7 +69,7 @@ public class DataLossProtect extends CommonBase { Reference.reachabilityFence(your_last_per_commitment_secret_arg); Reference.reachabilityFence(my_current_per_commitment_point_arg); if (ret >= 0 && ret <= 4096) { return null; } - DataLossProtect ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DataLossProtect(null, ret); } + org.ldk.structs.DataLossProtect ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DataLossProtect(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -87,7 +87,7 @@ public class DataLossProtect extends CommonBase { long ret = bindings.DataLossProtect_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - DataLossProtect ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DataLossProtect(null, ret); } + org.ldk.structs.DataLossProtect ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DataLossProtect(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/DecodeError.java b/src/main/java/org/ldk/structs/DecodeError.java index a6f4c479..3d00c3e7 100644 --- a/src/main/java/org/ldk/structs/DecodeError.java +++ b/src/main/java/org/ldk/structs/DecodeError.java @@ -33,7 +33,7 @@ public class DecodeError extends CommonBase { long ret = bindings.DecodeError_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - DecodeError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DecodeError(null, ret); } + org.ldk.structs.DecodeError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DecodeError(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/DefaultRouter.java b/src/main/java/org/ldk/structs/DefaultRouter.java index 4e444c78..6b51f922 100644 --- a/src/main/java/org/ldk/structs/DefaultRouter.java +++ b/src/main/java/org/ldk/structs/DefaultRouter.java @@ -30,7 +30,7 @@ public class DefaultRouter extends CommonBase { Reference.reachabilityFence(logger); Reference.reachabilityFence(random_seed_bytes); if (ret >= 0 && ret <= 4096) { return null; } - DefaultRouter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DefaultRouter(null, ret); } + org.ldk.structs.DefaultRouter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DefaultRouter(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(network_graph); ret_hu_conv.ptrs_to.add(logger); diff --git a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java index 8ab2a73b..d0480df2 100644 --- a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java @@ -28,7 +28,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { long ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -162,7 +162,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { Reference.reachabilityFence(channel_keys_id_arg); Reference.reachabilityFence(channel_value_satoshis_arg); if (ret >= 0 && ret <= 4096) { return null; } - DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret); } + org.ldk.structs.DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DelayedPaymentOutputDescriptor(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -180,7 +180,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { long ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret); } + org.ldk.structs.DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DelayedPaymentOutputDescriptor(null, ret); } 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 e6fa239f..c98a388c 100644 --- a/src/main/java/org/ldk/structs/Description.java +++ b/src/main/java/org/ldk/structs/Description.java @@ -36,7 +36,7 @@ public class Description extends CommonBase { long ret = bindings.Description_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Description(null, ret); } + org.ldk.structs.Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Description(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/DirectedChannelInfo.java b/src/main/java/org/ldk/structs/DirectedChannelInfo.java index be7271b4..c9629d84 100644 --- a/src/main/java/org/ldk/structs/DirectedChannelInfo.java +++ b/src/main/java/org/ldk/structs/DirectedChannelInfo.java @@ -34,7 +34,7 @@ public class DirectedChannelInfo extends CommonBase { long ret = bindings.DirectedChannelInfo_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - DirectedChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectedChannelInfo(null, ret); } + org.ldk.structs.DirectedChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DirectedChannelInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -46,7 +46,7 @@ public class DirectedChannelInfo extends CommonBase { long ret = bindings.DirectedChannelInfo_channel(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelInfo(null, ret); } + org.ldk.structs.ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -61,17 +61,26 @@ public class DirectedChannelInfo extends CommonBase { long ret = bindings.DirectedChannelInfo_direction(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdateInfo(null, ret); } + org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } + /** + * Returns the maximum HTLC amount allowed over the channel in the direction. + */ + public long htlc_maximum_msat() { + long ret = bindings.DirectedChannelInfo_htlc_maximum_msat(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns the [`EffectiveCapacity`] of the channel in the direction. * * This is either the total capacity from the funding transaction, if known, or the * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known, - * whichever is smaller. + * otherwise. */ public EffectiveCapacity effective_capacity() { long ret = bindings.DirectedChannelInfo_effective_capacity(this.ptr); diff --git a/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java b/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java index 21b66476..e7383de3 100644 --- a/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java @@ -31,7 +31,7 @@ public class DirectedChannelTransactionParameters extends CommonBase { long ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } + org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -43,7 +43,7 @@ public class DirectedChannelTransactionParameters extends CommonBase { long ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } + org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -77,7 +77,7 @@ public class DirectedChannelTransactionParameters extends CommonBase { long ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ErrorAction.java b/src/main/java/org/ldk/structs/ErrorAction.java index f5769f87..600fdb9d 100644 --- a/src/main/java/org/ldk/structs/ErrorAction.java +++ b/src/main/java/org/ldk/structs/ErrorAction.java @@ -55,7 +55,7 @@ public class ErrorAction extends CommonBase { private DisconnectPeer(long ptr, bindings.LDKErrorAction.DisconnectPeer obj) { super(null, ptr); long msg = obj.msg; - ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ErrorMessage(null, msg); } + org.ldk.structs.ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ErrorMessage(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -100,7 +100,7 @@ public class ErrorAction extends CommonBase { private SendErrorMessage(long ptr, bindings.LDKErrorAction.SendErrorMessage obj) { super(null, ptr); long msg = obj.msg; - ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ErrorMessage(null, msg); } + org.ldk.structs.ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ErrorMessage(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -122,7 +122,7 @@ public class ErrorAction extends CommonBase { private SendWarningMessage(long ptr, bindings.LDKErrorAction.SendWarningMessage obj) { super(null, ptr); long msg = obj.msg; - WarningMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new WarningMessage(null, msg); } + org.ldk.structs.WarningMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.WarningMessage(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; this.log_level = obj.log_level; diff --git a/src/main/java/org/ldk/structs/ErrorMessage.java b/src/main/java/org/ldk/structs/ErrorMessage.java index 22bbb8c4..eefe5253 100644 --- a/src/main/java/org/ldk/structs/ErrorMessage.java +++ b/src/main/java/org/ldk/structs/ErrorMessage.java @@ -76,7 +76,7 @@ public class ErrorMessage extends CommonBase { Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(data_arg); if (ret >= 0 && ret <= 4096) { return null; } - ErrorMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ErrorMessage(null, ret); } + org.ldk.structs.ErrorMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErrorMessage(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -94,7 +94,7 @@ public class ErrorMessage extends CommonBase { long ret = bindings.ErrorMessage_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ErrorMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ErrorMessage(null, ret); } + org.ldk.structs.ErrorMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErrorMessage(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ErroringMessageHandler.java b/src/main/java/org/ldk/structs/ErroringMessageHandler.java index 05310076..69cf787d 100644 --- a/src/main/java/org/ldk/structs/ErroringMessageHandler.java +++ b/src/main/java/org/ldk/structs/ErroringMessageHandler.java @@ -27,7 +27,7 @@ public class ErroringMessageHandler extends CommonBase { public static ErroringMessageHandler of() { long ret = bindings.ErroringMessageHandler_new(); if (ret >= 0 && ret <= 4096) { return null; } - ErroringMessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ErroringMessageHandler(null, ret); } + org.ldk.structs.ErroringMessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErroringMessageHandler(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Event.java b/src/main/java/org/ldk/structs/Event.java index f0e7bbc2..3a9d799e 100644 --- a/src/main/java/org/ldk/structs/Event.java +++ b/src/main/java/org/ldk/structs/Event.java @@ -31,15 +31,21 @@ public class Event extends CommonBase { if (raw_val.getClass() == bindings.LDKEvent.PaymentReceived.class) { return new PaymentReceived(ptr, (bindings.LDKEvent.PaymentReceived)raw_val); } + if (raw_val.getClass() == bindings.LDKEvent.PaymentClaimed.class) { + return new PaymentClaimed(ptr, (bindings.LDKEvent.PaymentClaimed)raw_val); + } if (raw_val.getClass() == bindings.LDKEvent.PaymentSent.class) { return new PaymentSent(ptr, (bindings.LDKEvent.PaymentSent)raw_val); } - if (raw_val.getClass() == bindings.LDKEvent.PaymentPathFailed.class) { - return new PaymentPathFailed(ptr, (bindings.LDKEvent.PaymentPathFailed)raw_val); - } if (raw_val.getClass() == bindings.LDKEvent.PaymentFailed.class) { return new PaymentFailed(ptr, (bindings.LDKEvent.PaymentFailed)raw_val); } + if (raw_val.getClass() == bindings.LDKEvent.PaymentPathSuccessful.class) { + return new PaymentPathSuccessful(ptr, (bindings.LDKEvent.PaymentPathSuccessful)raw_val); + } + if (raw_val.getClass() == bindings.LDKEvent.PaymentPathFailed.class) { + return new PaymentPathFailed(ptr, (bindings.LDKEvent.PaymentPathFailed)raw_val); + } if (raw_val.getClass() == bindings.LDKEvent.PendingHTLCsForwardable.class) { return new PendingHTLCsForwardable(ptr, (bindings.LDKEvent.PendingHTLCsForwardable)raw_val); } @@ -55,9 +61,6 @@ public class Event extends CommonBase { if (raw_val.getClass() == bindings.LDKEvent.DiscardFunding.class) { return new DiscardFunding(ptr, (bindings.LDKEvent.DiscardFunding)raw_val); } - if (raw_val.getClass() == bindings.LDKEvent.PaymentPathSuccessful.class) { - return new PaymentPathSuccessful(ptr, (bindings.LDKEvent.PaymentPathSuccessful)raw_val); - } if (raw_val.getClass() == bindings.LDKEvent.OpenChannelRequest.class) { return new OpenChannelRequest(ptr, (bindings.LDKEvent.OpenChannelRequest)raw_val); } @@ -77,9 +80,18 @@ public class Event extends CommonBase { public final static class FundingGenerationReady extends Event { /** * The random channel_id we picked which you'll need to pass into - * ChannelManager::funding_transaction_generated. + * [`ChannelManager::funding_transaction_generated`]. + * + * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated */ public final byte[] temporary_channel_id; + /** + * The counterparty's node_id, which you'll need to pass back into + * [`ChannelManager::funding_transaction_generated`]. + * + * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated + */ + public final byte[] counterparty_node_id; /** * The value, in satoshis, that the output should have. */ @@ -98,14 +110,16 @@ public class Event extends CommonBase { private FundingGenerationReady(long ptr, bindings.LDKEvent.FundingGenerationReady obj) { super(null, ptr); this.temporary_channel_id = obj.temporary_channel_id; + this.counterparty_node_id = obj.counterparty_node_id; this.channel_value_satoshis = obj.channel_value_satoshis; this.output_script = obj.output_script; this.user_channel_id = obj.user_channel_id; } } /** - * Indicates we've received money! Just gotta dig out that payment preimage and feed it to - * [`ChannelManager::claim_funds`] to get it.... + * Indicates we've received (an offer of) money! Just gotta dig out that payment preimage and + * feed it to [`ChannelManager::claim_funds`] to get it.... + * * Note that if the preimage is not known, you should call * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid * network congestion. @@ -129,7 +143,7 @@ public class Event extends CommonBase { /** * The value, in thousandths of a satoshi, that this payment is for. */ - public final long amt; + public final long amount_msat; /** * Information for claiming this received payment, based on whether the purpose of the * payment is to pay an invoice or to send a spontaneous payment. @@ -138,7 +152,48 @@ public class Event extends CommonBase { private PaymentReceived(long ptr, bindings.LDKEvent.PaymentReceived obj) { super(null, ptr); this.payment_hash = obj.payment_hash; - this.amt = obj.amt; + this.amount_msat = obj.amount_msat; + long purpose = obj.purpose; + org.ldk.structs.PaymentPurpose purpose_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(purpose); + purpose_hu_conv.ptrs_to.add(this); + this.purpose = purpose_hu_conv; + } + } + /** + * Indicates a payment has been claimed and we've received money! + * + * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response + * to an [`Event::PaymentReceived`]. However, if we previously crashed during a + * [`ChannelManager::claim_funds`] call you may see this event without a corresponding + * [`Event::PaymentReceived`] event. + * + * # Note + * LDK will not stop an inbound payment from being paid multiple times, so multiple + * `PaymentReceived` events may be generated for the same payment. If you then call + * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentReceived`] you may get + * multiple `PaymentClaimed` events. + * + * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds + */ + public final static class PaymentClaimed extends Event { + /** + * The payment hash of the claimed payment. Note that LDK will not stop you from + * registering duplicate payment hashes for inbound payments. + */ + public final byte[] payment_hash; + /** + * The value, in thousandths of a satoshi, that this payment is for. + */ + public final long amount_msat; + /** + * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a + * spontaneous payment. + */ + public final org.ldk.structs.PaymentPurpose purpose; + private PaymentClaimed(long ptr, bindings.LDKEvent.PaymentClaimed obj) { + super(null, ptr); + this.payment_hash = obj.payment_hash; + this.amount_msat = obj.amount_msat; long purpose = obj.purpose; org.ldk.structs.PaymentPurpose purpose_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(purpose); purpose_hu_conv.ptrs_to.add(this); @@ -198,6 +253,83 @@ public class Event extends CommonBase { this.fee_paid_msat = fee_paid_msat_hu_conv; } } + /** + * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events + * provide failure information for each MPP part in the payment. + * + * This event is provided once there are no further pending HTLCs for the payment and the + * payment is no longer retryable, either due to a several-block timeout or because + * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment. + * + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + */ + public final static class PaymentFailed extends Event { + /** + * The id returned by [`ChannelManager::send_payment`] and used with + * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + */ + public final byte[] payment_id; + /** + * The hash that was given to [`ChannelManager::send_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + */ + public final byte[] payment_hash; + private PaymentFailed(long ptr, bindings.LDKEvent.PaymentFailed obj) { + super(null, ptr); + this.payment_id = obj.payment_id; + this.payment_hash = obj.payment_hash; + } + } + /** + * Indicates that a path for an outbound payment was successful. + * + * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See + * [`Event::PaymentSent`] for obtaining the payment preimage. + */ + public final static class PaymentPathSuccessful extends Event { + /** + * The id returned by [`ChannelManager::send_payment`] and used with + * [`ChannelManager::retry_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment + */ + public final byte[] payment_id; + /** + * The hash that was given to [`ChannelManager::send_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final byte[] payment_hash; + /** + * The payment path that was successful. + * + * May contain a closed channel if the HTLC sent along the path was fulfilled on chain. + */ + public final RouteHop[] path; + private PaymentPathSuccessful(long ptr, bindings.LDKEvent.PaymentPathSuccessful obj) { + super(null, ptr); + this.payment_id = obj.payment_id; + this.payment_hash = obj.payment_hash; + long[] path = obj.path; + int path_conv_10_len = path.length; + RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len]; + for (int k = 0; k < path_conv_10_len; k++) { + long path_conv_10 = path[k]; + org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); } + path_conv_10_hu_conv.ptrs_to.add(this); + path_conv_10_arr[k] = path_conv_10_hu_conv; + } + this.path = path_conv_10_arr; + } + } /** * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped * something. You may wish to retry with a different route. @@ -236,10 +368,9 @@ public class Event extends CommonBase { * payment route. * * Should be applied to the [`NetworkGraph`] so that routing decisions can take into - * account the update. [`NetGraphMsgHandler`] is capable of doing this. + * account the update. * - * [`NetworkGraph`]: crate::routing::network_graph::NetworkGraph - * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler + * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph */ public final org.ldk.structs.Option_NetworkUpdateZ network_update; /** @@ -269,6 +400,10 @@ public class Event extends CommonBase { /** * The channel responsible for the failed payment path. * + * Note that for route hints or for the first hop in a path this may be an SCID alias and + * may not refer to a channel in the public network graph. These aliases may also collide + * with channels in the public network graph. + * * If this is `Some`, then the corresponding channel should be avoided when the payment is * retried. May be `None` for older [`Event`] serializations. */ @@ -299,7 +434,7 @@ public class Event extends CommonBase { RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len]; for (int k = 0; k < path_conv_10_len; k++) { long path_conv_10 = path[k]; - RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new RouteHop(null, path_conv_10); } + org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); } path_conv_10_hu_conv.ptrs_to.add(this); path_conv_10_arr[k] = path_conv_10_hu_conv; } @@ -309,43 +444,11 @@ public class Event extends CommonBase { short_channel_id_hu_conv.ptrs_to.add(this); this.short_channel_id = short_channel_id_hu_conv; long retry = obj.retry; - RouteParameters retry_hu_conv = null; if (retry < 0 || retry > 4096) { retry_hu_conv = new RouteParameters(null, retry); } + org.ldk.structs.RouteParameters retry_hu_conv = null; if (retry < 0 || retry > 4096) { retry_hu_conv = new org.ldk.structs.RouteParameters(null, retry); } retry_hu_conv.ptrs_to.add(this); this.retry = retry_hu_conv; } } - /** - * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events - * provide failure information for each MPP part in the payment. - * - * This event is provided once there are no further pending HTLCs for the payment and the - * payment is no longer retryable, either due to a several-block timeout or because - * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment. - * - * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment - */ - public final static class PaymentFailed extends Event { - /** - * The id returned by [`ChannelManager::send_payment`] and used with - * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`]. - * - * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment - * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment - */ - public final byte[] payment_id; - /** - * The hash that was given to [`ChannelManager::send_payment`]. - * - * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment - */ - public final byte[] payment_hash; - private PaymentFailed(long ptr, bindings.LDKEvent.PaymentFailed obj) { - super(null, ptr); - this.payment_id = obj.payment_id; - this.payment_hash = obj.payment_hash; - } - } /** * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at * a time in the future. @@ -396,6 +499,20 @@ public class Event extends CommonBase { * forwarding fee earned. */ public final static class PaymentForwarded extends Event { + /** + * The incoming channel between the previous node and us. This is only `None` for events + * generated or serialized by versions prior to 0.0.107. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final byte[] prev_channel_id; + /** + * The outgoing channel between the next node and us. This is only `None` for events + * generated or serialized by versions prior to 0.0.107. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final byte[] next_channel_id; /** * The fee, in milli-satoshis, which was earned as a result of the payment. * @@ -419,6 +536,8 @@ public class Event extends CommonBase { public final boolean claim_from_onchain_tx; private PaymentForwarded(long ptr, bindings.LDKEvent.PaymentForwarded obj) { super(null, ptr); + this.prev_channel_id = obj.prev_channel_id; + this.next_channel_id = obj.next_channel_id; long fee_earned_msat = obj.fee_earned_msat; org.ldk.structs.Option_u64Z fee_earned_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(fee_earned_msat); fee_earned_msat_hu_conv.ptrs_to.add(this); @@ -427,7 +546,8 @@ public class Event extends CommonBase { } } /** - * Used to indicate that a channel with the given `channel_id` is in the process of closure. + * Used to indicate that a previously opened channel with the given `channel_id` is in the + * process of closure. */ public final static class ChannelClosed extends Event { /** @@ -480,51 +600,6 @@ public class Event extends CommonBase { this.transaction = obj.transaction; } } - /** - * Indicates that a path for an outbound payment was successful. - * - * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See - * [`Event::PaymentSent`] for obtaining the payment preimage. - */ - public final static class PaymentPathSuccessful extends Event { - /** - * The id returned by [`ChannelManager::send_payment`] and used with - * [`ChannelManager::retry_payment`]. - * - * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment - * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment - */ - public final byte[] payment_id; - /** - * The hash that was given to [`ChannelManager::send_payment`]. - * - * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment - * - * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - @Nullable public final byte[] payment_hash; - /** - * The payment path that was successful. - * - * May contain a closed channel if the HTLC sent along the path was fulfilled on chain. - */ - public final RouteHop[] path; - private PaymentPathSuccessful(long ptr, bindings.LDKEvent.PaymentPathSuccessful obj) { - super(null, ptr); - this.payment_id = obj.payment_id; - this.payment_hash = obj.payment_hash; - long[] path = obj.path; - int path_conv_10_len = path.length; - RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len]; - for (int k = 0; k < path_conv_10_len; k++) { - long path_conv_10 = path[k]; - RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new RouteHop(null, path_conv_10); } - path_conv_10_hu_conv.ptrs_to.add(this); - path_conv_10_arr[k] = path_conv_10_hu_conv; - } - this.path = path_conv_10_arr; - } - } /** * Indicates a request to open a new channel by a peer. * @@ -543,8 +618,8 @@ public class Event extends CommonBase { * The temporary channel ID of the channel requested to be opened. * * When responding to the request, the `temporary_channel_id` should be passed - * back to the ChannelManager with [`ChannelManager::accept_inbound_channel`] to accept, - * or to [`ChannelManager::force_close_channel`] to reject. + * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept, + * or through [`ChannelManager::force_close_channel`] to reject. * * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel @@ -552,6 +627,14 @@ public class Event extends CommonBase { public final byte[] temporary_channel_id; /** * The node_id of the counterparty requesting to open the channel. + * + * When responding to the request, the `counterparty_node_id` should be passed + * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to + * accept the request, or through [`ChannelManager::force_close_channel`] to reject the + * request. + * + * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel + * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel */ public final byte[] counterparty_node_id; /** @@ -571,6 +654,12 @@ public class Event extends CommonBase { * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to * 0.0.106. * + * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type, + * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to + * 0.0.107. Channels setting this type also need to get manually accepted via + * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`], + * or will be rejected otherwise. + * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public final org.ldk.structs.ChannelTypeFeatures channel_type; @@ -581,7 +670,7 @@ public class Event extends CommonBase { this.funding_satoshis = obj.funding_satoshis; this.push_msat = obj.push_msat; long channel_type = obj.channel_type; - ChannelTypeFeatures channel_type_hu_conv = null; if (channel_type < 0 || channel_type > 4096) { channel_type_hu_conv = new ChannelTypeFeatures(null, 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); } channel_type_hu_conv.ptrs_to.add(this); this.channel_type = channel_type_hu_conv; } @@ -607,9 +696,10 @@ public class Event extends CommonBase { /** * Utility method to constructs a new FundingGenerationReady-variant Event */ - public static Event funding_generation_ready(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { - long ret = bindings.Event_funding_generation_ready(InternalUtils.check_arr_len(temporary_channel_id, 32), channel_value_satoshis, output_script, user_channel_id); + public static Event funding_generation_ready(byte[] temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { + long ret = bindings.Event_funding_generation_ready(InternalUtils.check_arr_len(temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), channel_value_satoshis, output_script, user_channel_id); Reference.reachabilityFence(temporary_channel_id); + Reference.reachabilityFence(counterparty_node_id); Reference.reachabilityFence(channel_value_satoshis); Reference.reachabilityFence(output_script); Reference.reachabilityFence(user_channel_id); @@ -622,10 +712,24 @@ public class Event extends CommonBase { /** * Utility method to constructs a new PaymentReceived-variant Event */ - public static Event payment_received(byte[] payment_hash, long amt, PaymentPurpose purpose) { - long ret = bindings.Event_payment_received(InternalUtils.check_arr_len(payment_hash, 32), amt, purpose.ptr); + public static Event payment_received(byte[] payment_hash, long amount_msat, PaymentPurpose purpose) { + long ret = bindings.Event_payment_received(InternalUtils.check_arr_len(payment_hash, 32), amount_msat, purpose.ptr); + Reference.reachabilityFence(payment_hash); + Reference.reachabilityFence(amount_msat); + Reference.reachabilityFence(purpose); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Utility method to constructs a new PaymentClaimed-variant Event + */ + public static Event payment_claimed(byte[] payment_hash, long amount_msat, PaymentPurpose purpose) { + long ret = bindings.Event_payment_claimed(InternalUtils.check_arr_len(payment_hash, 32), amount_msat, purpose.ptr); Reference.reachabilityFence(payment_hash); - Reference.reachabilityFence(amt); + Reference.reachabilityFence(amount_msat); Reference.reachabilityFence(purpose); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); @@ -649,18 +753,26 @@ public class Event extends CommonBase { } /** - * Utility method to constructs a new PaymentPathFailed-variant Event + * Utility method to constructs a new PaymentFailed-variant Event */ - public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) { - long ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr & ~1); + public static Event payment_failed(byte[] payment_id, byte[] payment_hash) { + long ret = bindings.Event_payment_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32)); + Reference.reachabilityFence(payment_id); + Reference.reachabilityFence(payment_hash); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Utility method to constructs a new PaymentPathSuccessful-variant Event + */ + public static Event payment_path_successful(byte[] payment_id, byte[] payment_hash, RouteHop[] path) { + long ret = bindings.Event_payment_path_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null); Reference.reachabilityFence(payment_id); Reference.reachabilityFence(payment_hash); - Reference.reachabilityFence(rejected_by_dest); - Reference.reachabilityFence(network_update); - Reference.reachabilityFence(all_paths_failed); Reference.reachabilityFence(path); - Reference.reachabilityFence(short_channel_id); - Reference.reachabilityFence(retry); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -668,12 +780,18 @@ public class Event extends CommonBase { } /** - * Utility method to constructs a new PaymentFailed-variant Event + * Utility method to constructs a new PaymentPathFailed-variant Event */ - public static Event payment_failed(byte[] payment_id, byte[] payment_hash) { - long ret = bindings.Event_payment_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32)); + public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) { + long ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr & ~1); Reference.reachabilityFence(payment_id); Reference.reachabilityFence(payment_hash); + Reference.reachabilityFence(rejected_by_dest); + Reference.reachabilityFence(network_update); + Reference.reachabilityFence(all_paths_failed); + Reference.reachabilityFence(path); + Reference.reachabilityFence(short_channel_id); + Reference.reachabilityFence(retry); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); @@ -707,8 +825,10 @@ public class Event extends CommonBase { /** * Utility method to constructs a new PaymentForwarded-variant Event */ - public static Event payment_forwarded(Option_u64Z fee_earned_msat, boolean claim_from_onchain_tx) { - long ret = bindings.Event_payment_forwarded(fee_earned_msat.ptr, claim_from_onchain_tx); + public static Event payment_forwarded(byte[] prev_channel_id, byte[] next_channel_id, Option_u64Z fee_earned_msat, boolean claim_from_onchain_tx) { + long ret = bindings.Event_payment_forwarded(InternalUtils.check_arr_len(prev_channel_id, 32), InternalUtils.check_arr_len(next_channel_id, 32), fee_earned_msat.ptr, claim_from_onchain_tx); + Reference.reachabilityFence(prev_channel_id); + Reference.reachabilityFence(next_channel_id); Reference.reachabilityFence(fee_earned_msat); Reference.reachabilityFence(claim_from_onchain_tx); if (ret >= 0 && ret <= 4096) { return null; } @@ -744,20 +864,6 @@ public class Event extends CommonBase { return ret_hu_conv; } - /** - * Utility method to constructs a new PaymentPathSuccessful-variant Event - */ - public static Event payment_path_successful(byte[] payment_id, byte[] payment_hash, RouteHop[] path) { - long ret = bindings.Event_payment_path_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null); - Reference.reachabilityFence(payment_id); - Reference.reachabilityFence(payment_hash); - Reference.reachabilityFence(path); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); - return ret_hu_conv; - } - /** * Utility method to constructs a new OpenChannelRequest-variant Event */ diff --git a/src/main/java/org/ldk/structs/ExpandedKey.java b/src/main/java/org/ldk/structs/ExpandedKey.java new file mode 100644 index 00000000..16d1428a --- /dev/null +++ b/src/main/java/org/ldk/structs/ExpandedKey.java @@ -0,0 +1,40 @@ +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 set of keys that were HKDF-expanded from an initial call to + * [`KeysInterface::get_inbound_payment_key_material`]. + * + * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class ExpandedKey extends CommonBase { + ExpandedKey(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.ExpandedKey_free(ptr); } + } + + /** + * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret. + * + * It is recommended to cache this value and not regenerate it for each new inbound payment. + */ + public static ExpandedKey of(byte[] key_material) { + long ret = bindings.ExpandedKey_new(InternalUtils.check_arr_len(key_material, 32)); + Reference.reachabilityFence(key_material); + 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); } + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/ExpiryTime.java b/src/main/java/org/ldk/structs/ExpiryTime.java index 07601ecc..16881624 100644 --- a/src/main/java/org/ldk/structs/ExpiryTime.java +++ b/src/main/java/org/ldk/structs/ExpiryTime.java @@ -34,7 +34,7 @@ public class ExpiryTime extends CommonBase { long ret = bindings.ExpiryTime_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ExpiryTime(null, ret); } + org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -75,7 +75,7 @@ public class ExpiryTime extends CommonBase { long ret = bindings.ExpiryTime_from_seconds(seconds); Reference.reachabilityFence(seconds); if (ret >= 0 && ret <= 4096) { return null; } - ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ExpiryTime(null, ret); } + org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -87,7 +87,7 @@ public class ExpiryTime extends CommonBase { long ret = bindings.ExpiryTime_from_duration(duration); Reference.reachabilityFence(duration); if (ret >= 0 && ret <= 4096) { return null; } - ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ExpiryTime(null, ret); } + org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/FilesystemPersister.java b/src/main/java/org/ldk/structs/FilesystemPersister.java index a274e07b..5da5c1c1 100644 --- a/src/main/java/org/ldk/structs/FilesystemPersister.java +++ b/src/main/java/org/ldk/structs/FilesystemPersister.java @@ -39,7 +39,7 @@ public class FilesystemPersister extends CommonBase { long ret = bindings.FilesystemPersister_new(path_to_channel_data); Reference.reachabilityFence(path_to_channel_data); if (ret >= 0 && ret <= 4096) { return null; } - FilesystemPersister ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FilesystemPersister(null, ret); } + org.ldk.structs.FilesystemPersister ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FilesystemPersister(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -66,17 +66,4 @@ public class FilesystemPersister extends CommonBase { return ret_hu_conv; } - /** - * Constructs a new Persist which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is - */ - public Persist as_Persist() { - long ret = bindings.FilesystemPersister_as_Persist(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Persist ret_hu_conv = new Persist(null, ret); - ret_hu_conv.ptrs_to.add(this); - return ret_hu_conv; - } - } diff --git a/src/main/java/org/ldk/structs/Filter.java b/src/main/java/org/ldk/structs/Filter.java index 8d3e19fb..7b80a339 100644 --- a/src/main/java/org/ldk/structs/Filter.java +++ b/src/main/java/org/ldk/structs/Filter.java @@ -71,7 +71,7 @@ public class Filter extends CommonBase { Reference.reachabilityFence(arg); } @Override public long register_output(long output) { - WatchedOutput output_hu_conv = null; if (output < 0 || output > 4096) { output_hu_conv = new WatchedOutput(null, output); } + org.ldk.structs.WatchedOutput output_hu_conv = null; if (output < 0 || output > 4096) { output_hu_conv = new org.ldk.structs.WatchedOutput(null, output); } output_hu_conv.ptrs_to.add(this); Option_C2Tuple_usizeTransactionZZ ret = arg.register_output(output_hu_conv); Reference.reachabilityFence(arg); diff --git a/src/main/java/org/ldk/structs/FixedPenaltyScorer.java b/src/main/java/org/ldk/structs/FixedPenaltyScorer.java index c2e427d1..b6e972a9 100644 --- a/src/main/java/org/ldk/structs/FixedPenaltyScorer.java +++ b/src/main/java/org/ldk/structs/FixedPenaltyScorer.java @@ -33,7 +33,7 @@ public class FixedPenaltyScorer extends CommonBase { long ret = bindings.FixedPenaltyScorer_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - FixedPenaltyScorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FixedPenaltyScorer(null, ret); } + org.ldk.structs.FixedPenaltyScorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FixedPenaltyScorer(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -45,7 +45,7 @@ public class FixedPenaltyScorer extends CommonBase { long ret = bindings.FixedPenaltyScorer_with_penalty(penalty_msat); Reference.reachabilityFence(penalty_msat); if (ret >= 0 && ret <= 4096) { return null; } - FixedPenaltyScorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FixedPenaltyScorer(null, ret); } + org.ldk.structs.FixedPenaltyScorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FixedPenaltyScorer(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/FundingCreated.java b/src/main/java/org/ldk/structs/FundingCreated.java index 37168a00..aeb6ffe1 100644 --- a/src/main/java/org/ldk/structs/FundingCreated.java +++ b/src/main/java/org/ldk/structs/FundingCreated.java @@ -102,7 +102,7 @@ public class FundingCreated extends CommonBase { Reference.reachabilityFence(funding_output_index_arg); Reference.reachabilityFence(signature_arg); if (ret >= 0 && ret <= 4096) { return null; } - FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); } + org.ldk.structs.FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingCreated(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -120,7 +120,7 @@ public class FundingCreated extends CommonBase { long ret = bindings.FundingCreated_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); } + org.ldk.structs.FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingCreated(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/FundingSigned.java b/src/main/java/org/ldk/structs/FundingSigned.java index b992038d..c4b44d55 100644 --- a/src/main/java/org/ldk/structs/FundingSigned.java +++ b/src/main/java/org/ldk/structs/FundingSigned.java @@ -64,7 +64,7 @@ public class FundingSigned extends CommonBase { Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(signature_arg); if (ret >= 0 && ret <= 4096) { return null; } - FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingSigned(null, ret); } + org.ldk.structs.FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingSigned(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -82,7 +82,7 @@ public class FundingSigned extends CommonBase { long ret = bindings.FundingSigned_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingSigned(null, ret); } + org.ldk.structs.FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingSigned(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/GossipSync.java b/src/main/java/org/ldk/structs/GossipSync.java new file mode 100644 index 00000000..7c62cc7a --- /dev/null +++ b/src/main/java/org/ldk/structs/GossipSync.java @@ -0,0 +1,107 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Either [`P2PGossipSync`] or [`RapidGossipSync`]. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class GossipSync extends CommonBase { + private GossipSync(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.GossipSync_free(ptr); } + } + static GossipSync constr_from_ptr(long ptr) { + bindings.LDKGossipSync raw_val = bindings.LDKGossipSync_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKGossipSync.P2P.class) { + return new P2P(ptr, (bindings.LDKGossipSync.P2P)raw_val); + } + if (raw_val.getClass() == bindings.LDKGossipSync.Rapid.class) { + return new Rapid(ptr, (bindings.LDKGossipSync.Rapid)raw_val); + } + if (raw_val.getClass() == bindings.LDKGossipSync.None.class) { + return new None(ptr, (bindings.LDKGossipSync.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7. + */ + public final static class P2P extends GossipSync { + public final org.ldk.structs.P2PGossipSync p2p; + private P2P(long ptr, bindings.LDKGossipSync.P2P obj) { + super(null, ptr); + long p2p = obj.p2p; + org.ldk.structs.P2PGossipSync p2p_hu_conv = null; if (p2p < 0 || p2p > 4096) { p2p_hu_conv = new org.ldk.structs.P2PGossipSync(null, p2p); } + p2p_hu_conv.ptrs_to.add(this); + this.p2p = p2p_hu_conv; + } + } + /** + * Rapid gossip sync from a trusted server. + */ + public final static class Rapid extends GossipSync { + public final org.ldk.structs.RapidGossipSync rapid; + private Rapid(long ptr, bindings.LDKGossipSync.Rapid obj) { + super(null, ptr); + long rapid = obj.rapid; + org.ldk.structs.RapidGossipSync rapid_hu_conv = null; if (rapid < 0 || rapid > 4096) { rapid_hu_conv = new org.ldk.structs.RapidGossipSync(null, rapid); } + rapid_hu_conv.ptrs_to.add(this); + this.rapid = rapid_hu_conv; + } + } + /** + * No gossip sync. + */ + public final static class None extends GossipSync { + private None(long ptr, bindings.LDKGossipSync.None obj) { + super(null, ptr); + } + } + /** + * Utility method to constructs a new P2P-variant GossipSync + */ + public static GossipSync p2_p(P2PGossipSync a) { + long ret = bindings.GossipSync_p2_p(a == null ? 0 : a.ptr & ~1); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.GossipSync ret_hu_conv = org.ldk.structs.GossipSync.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(a); + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Rapid-variant GossipSync + */ + public static GossipSync rapid(RapidGossipSync a) { + long ret = bindings.GossipSync_rapid(a == null ? 0 : a.ptr & ~1); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.GossipSync ret_hu_conv = org.ldk.structs.GossipSync.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(a); + return ret_hu_conv; + } + + /** + * Utility method to constructs a new None-variant GossipSync + */ + public static GossipSync none() { + long ret = bindings.GossipSync_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.GossipSync ret_hu_conv = org.ldk.structs.GossipSync.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/GossipTimestampFilter.java b/src/main/java/org/ldk/structs/GossipTimestampFilter.java index f6692176..e6a0475b 100644 --- a/src/main/java/org/ldk/structs/GossipTimestampFilter.java +++ b/src/main/java/org/ldk/structs/GossipTimestampFilter.java @@ -85,7 +85,7 @@ public class GossipTimestampFilter extends CommonBase { Reference.reachabilityFence(first_timestamp_arg); Reference.reachabilityFence(timestamp_range_arg); if (ret >= 0 && ret <= 4096) { return null; } - GossipTimestampFilter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new GossipTimestampFilter(null, ret); } + org.ldk.structs.GossipTimestampFilter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -103,7 +103,7 @@ public class GossipTimestampFilter extends CommonBase { long ret = bindings.GossipTimestampFilter_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - GossipTimestampFilter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new GossipTimestampFilter(null, ret); } + org.ldk.structs.GossipTimestampFilter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/GraphSyncError.java b/src/main/java/org/ldk/structs/GraphSyncError.java new file mode 100644 index 00000000..67f4d2d9 --- /dev/null +++ b/src/main/java/org/ldk/structs/GraphSyncError.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; + + +/** + * All-encompassing standard error type that processing can return + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class GraphSyncError extends CommonBase { + private GraphSyncError(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.GraphSyncError_free(ptr); } + } + static GraphSyncError constr_from_ptr(long ptr) { + bindings.LDKGraphSyncError raw_val = bindings.LDKGraphSyncError_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKGraphSyncError.DecodeError.class) { + return new DecodeError(ptr, (bindings.LDKGraphSyncError.DecodeError)raw_val); + } + if (raw_val.getClass() == bindings.LDKGraphSyncError.LightningError.class) { + return new LightningError(ptr, (bindings.LDKGraphSyncError.LightningError)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * Error trying to read the update data, typically due to an erroneous data length indication + * that is greater than the actual amount of data provided + */ + public final static class DecodeError extends GraphSyncError { + public final org.ldk.structs.DecodeError decode_error; + private DecodeError(long ptr, bindings.LDKGraphSyncError.DecodeError obj) { + super(null, ptr); + long decode_error = obj.decode_error; + org.ldk.structs.DecodeError decode_error_hu_conv = null; if (decode_error < 0 || decode_error > 4096) { decode_error_hu_conv = new org.ldk.structs.DecodeError(null, decode_error); } + decode_error_hu_conv.ptrs_to.add(this); + this.decode_error = decode_error_hu_conv; + } + } + /** + * Error applying the patch to the network graph, usually the result of updates that are too + * old or missing prerequisite data to the application of updates out of order + */ + public final static class LightningError extends GraphSyncError { + public final org.ldk.structs.LightningError lightning_error; + private LightningError(long ptr, bindings.LDKGraphSyncError.LightningError obj) { + super(null, ptr); + long lightning_error = obj.lightning_error; + org.ldk.structs.LightningError lightning_error_hu_conv = null; if (lightning_error < 0 || lightning_error > 4096) { lightning_error_hu_conv = new org.ldk.structs.LightningError(null, lightning_error); } + lightning_error_hu_conv.ptrs_to.add(this); + this.lightning_error = lightning_error_hu_conv; + } + } + long clone_ptr() { + long ret = bindings.GraphSyncError_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the GraphSyncError + */ + public GraphSyncError clone() { + long ret = bindings.GraphSyncError_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Utility method to constructs a new DecodeError-variant GraphSyncError + */ + public static GraphSyncError decode_error(DecodeError a) { + long ret = bindings.GraphSyncError_decode_error(a == null ? 0 : a.ptr & ~1); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Utility method to constructs a new LightningError-variant GraphSyncError + */ + public static GraphSyncError lightning_error(LightningError a) { + long ret = bindings.GraphSyncError_lightning_error(a == null ? 0 : a.ptr & ~1); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java index 91c2e6f4..196cb479 100644 --- a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java +++ b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java @@ -136,7 +136,7 @@ public class HTLCOutputInCommitment extends CommonBase { Reference.reachabilityFence(payment_hash_arg); Reference.reachabilityFence(transaction_output_index_arg); if (ret >= 0 && ret <= 4096) { return null; } - HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HTLCOutputInCommitment(null, ret); } + org.ldk.structs.HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -154,7 +154,7 @@ public class HTLCOutputInCommitment extends CommonBase { long ret = bindings.HTLCOutputInCommitment_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HTLCOutputInCommitment(null, ret); } + org.ldk.structs.HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/HTLCUpdate.java b/src/main/java/org/ldk/structs/HTLCUpdate.java index 96789c0a..c829cd3e 100644 --- a/src/main/java/org/ldk/structs/HTLCUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCUpdate.java @@ -35,7 +35,7 @@ public class HTLCUpdate extends CommonBase { long ret = bindings.HTLCUpdate_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - HTLCUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HTLCUpdate(null, ret); } + org.ldk.structs.HTLCUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java index c37903dc..72885698 100644 --- a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java @@ -62,7 +62,7 @@ public class HolderCommitmentTransaction extends CommonBase { long ret = bindings.HolderCommitmentTransaction_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - HolderCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HolderCommitmentTransaction(null, ret); } + org.ldk.structs.HolderCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -99,7 +99,7 @@ public class HolderCommitmentTransaction extends CommonBase { Reference.reachabilityFence(holder_funding_key); Reference.reachabilityFence(counterparty_funding_key); if (ret >= 0 && ret <= 4096) { return null; } - HolderCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HolderCommitmentTransaction(null, ret); } + org.ldk.structs.HolderCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); 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 cfee35fe..d81967f0 100644 --- a/src/main/java/org/ldk/structs/IgnoringMessageHandler.java +++ b/src/main/java/org/ldk/structs/IgnoringMessageHandler.java @@ -27,7 +27,7 @@ public class IgnoringMessageHandler extends CommonBase { public static IgnoringMessageHandler of() { long ret = bindings.IgnoringMessageHandler_new(); if (ret >= 0 && ret <= 4096) { return null; } - IgnoringMessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new IgnoringMessageHandler(null, ret); } + org.ldk.structs.IgnoringMessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.IgnoringMessageHandler(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/InMemorySigner.java b/src/main/java/org/ldk/structs/InMemorySigner.java index f166a47e..f7c1c75e 100644 --- a/src/main/java/org/ldk/structs/InMemorySigner.java +++ b/src/main/java/org/ldk/structs/InMemorySigner.java @@ -144,7 +144,7 @@ public class InMemorySigner extends CommonBase { long ret = bindings.InMemorySigner_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); } + org.ldk.structs.InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InMemorySigner(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -164,7 +164,7 @@ public class InMemorySigner extends CommonBase { Reference.reachabilityFence(channel_value_satoshis); Reference.reachabilityFence(channel_keys_id); if (ret >= 0 && ret <= 4096) { return null; } - InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); } + org.ldk.structs.InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InMemorySigner(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -177,7 +177,7 @@ public class InMemorySigner extends CommonBase { long ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); } + org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -224,7 +224,7 @@ public class InMemorySigner extends CommonBase { long ret = bindings.InMemorySigner_funding_outpoint(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -239,7 +239,7 @@ public class InMemorySigner extends CommonBase { long ret = bindings.InMemorySigner_get_channel_parameters(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTransactionParameters(null, ret); } + org.ldk.structs.ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Init.java b/src/main/java/org/ldk/structs/Init.java index 35d54038..25d509ca 100644 --- a/src/main/java/org/ldk/structs/Init.java +++ b/src/main/java/org/ldk/structs/Init.java @@ -27,7 +27,7 @@ public class Init extends CommonBase { long ret = bindings.Init_get_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -76,7 +76,7 @@ public class Init extends CommonBase { Reference.reachabilityFence(features_arg); Reference.reachabilityFence(remote_network_address_arg); if (ret >= 0 && ret <= 4096) { return null; } - Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Init(null, ret); } + org.ldk.structs.Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Init(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -94,7 +94,7 @@ public class Init extends CommonBase { long ret = bindings.Init_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Init(null, ret); } + org.ldk.structs.Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Init(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/InitFeatures.java b/src/main/java/org/ldk/structs/InitFeatures.java index 1c4cee2d..f645123e 100644 --- a/src/main/java/org/ldk/structs/InitFeatures.java +++ b/src/main/java/org/ldk/structs/InitFeatures.java @@ -50,7 +50,7 @@ public class InitFeatures extends CommonBase { long ret = bindings.InitFeatures_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -61,7 +61,7 @@ public class InitFeatures extends CommonBase { public static InitFeatures empty() { long ret = bindings.InitFeatures_empty(); if (ret >= 0 && ret <= 4096) { return null; } - InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -72,7 +72,7 @@ public class InitFeatures extends CommonBase { public static InitFeatures known() { long ret = bindings.InitFeatures_known(); if (ret >= 0 && ret <= 4096) { return null; } - InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -107,4 +107,437 @@ public class InitFeatures extends CommonBase { return ret_hu_conv; } + /** + * Set this feature as optional. + */ + public void set_data_loss_protect_optional() { + bindings.InitFeatures_set_data_loss_protect_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_data_loss_protect_required() { + bindings.InitFeatures_set_data_loss_protect_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_data_loss_protect() { + boolean ret = bindings.InitFeatures_supports_data_loss_protect(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_data_loss_protect() { + boolean ret = bindings.InitFeatures_requires_data_loss_protect(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_initial_routing_sync_optional() { + bindings.InitFeatures_set_initial_routing_sync_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_initial_routing_sync_required() { + bindings.InitFeatures_set_initial_routing_sync_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean initial_routing_sync() { + boolean ret = bindings.InitFeatures_initial_routing_sync(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_upfront_shutdown_script_optional() { + bindings.InitFeatures_set_upfront_shutdown_script_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_upfront_shutdown_script_required() { + bindings.InitFeatures_set_upfront_shutdown_script_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_upfront_shutdown_script() { + boolean ret = bindings.InitFeatures_supports_upfront_shutdown_script(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_upfront_shutdown_script() { + boolean ret = bindings.InitFeatures_requires_upfront_shutdown_script(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_gossip_queries_optional() { + bindings.InitFeatures_set_gossip_queries_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_gossip_queries_required() { + bindings.InitFeatures_set_gossip_queries_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_gossip_queries() { + boolean ret = bindings.InitFeatures_supports_gossip_queries(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_gossip_queries() { + boolean ret = bindings.InitFeatures_requires_gossip_queries(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_variable_length_onion_optional() { + bindings.InitFeatures_set_variable_length_onion_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_variable_length_onion_required() { + bindings.InitFeatures_set_variable_length_onion_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_variable_length_onion() { + boolean ret = bindings.InitFeatures_supports_variable_length_onion(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_variable_length_onion() { + boolean ret = bindings.InitFeatures_requires_variable_length_onion(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_static_remote_key_optional() { + bindings.InitFeatures_set_static_remote_key_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_static_remote_key_required() { + bindings.InitFeatures_set_static_remote_key_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_static_remote_key() { + boolean ret = bindings.InitFeatures_supports_static_remote_key(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_static_remote_key() { + boolean ret = bindings.InitFeatures_requires_static_remote_key(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_payment_secret_optional() { + bindings.InitFeatures_set_payment_secret_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_payment_secret_required() { + bindings.InitFeatures_set_payment_secret_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_payment_secret() { + boolean ret = bindings.InitFeatures_supports_payment_secret(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_payment_secret() { + boolean ret = bindings.InitFeatures_requires_payment_secret(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_basic_mpp_optional() { + bindings.InitFeatures_set_basic_mpp_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_basic_mpp_required() { + bindings.InitFeatures_set_basic_mpp_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_basic_mpp() { + boolean ret = bindings.InitFeatures_supports_basic_mpp(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_basic_mpp() { + boolean ret = bindings.InitFeatures_requires_basic_mpp(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_wumbo_optional() { + bindings.InitFeatures_set_wumbo_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_wumbo_required() { + bindings.InitFeatures_set_wumbo_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_wumbo() { + boolean ret = bindings.InitFeatures_supports_wumbo(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_wumbo() { + boolean ret = bindings.InitFeatures_requires_wumbo(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_shutdown_any_segwit_optional() { + bindings.InitFeatures_set_shutdown_any_segwit_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_shutdown_any_segwit_required() { + bindings.InitFeatures_set_shutdown_any_segwit_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_shutdown_anysegwit() { + boolean ret = bindings.InitFeatures_supports_shutdown_anysegwit(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_shutdown_anysegwit() { + boolean ret = bindings.InitFeatures_requires_shutdown_anysegwit(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_channel_type_optional() { + bindings.InitFeatures_set_channel_type_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_channel_type_required() { + bindings.InitFeatures_set_channel_type_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_channel_type() { + boolean ret = bindings.InitFeatures_supports_channel_type(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_channel_type() { + boolean ret = bindings.InitFeatures_requires_channel_type(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_scid_privacy_optional() { + bindings.InitFeatures_set_scid_privacy_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_scid_privacy_required() { + bindings.InitFeatures_set_scid_privacy_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_scid_privacy() { + boolean ret = bindings.InitFeatures_supports_scid_privacy(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_scid_privacy() { + boolean ret = bindings.InitFeatures_requires_scid_privacy(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_zero_conf_optional() { + bindings.InitFeatures_set_zero_conf_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_zero_conf_required() { + bindings.InitFeatures_set_zero_conf_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_zero_conf() { + boolean ret = bindings.InitFeatures_supports_zero_conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_zero_conf() { + boolean ret = bindings.InitFeatures_requires_zero_conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/InvalidShutdownScript.java b/src/main/java/org/ldk/structs/InvalidShutdownScript.java index 74bbc19c..9c666185 100644 --- a/src/main/java/org/ldk/structs/InvalidShutdownScript.java +++ b/src/main/java/org/ldk/structs/InvalidShutdownScript.java @@ -23,7 +23,7 @@ public class InvalidShutdownScript extends CommonBase { /** * The script that did not meet the requirements from [BOLT #2]. * - * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md + * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md */ public byte[] get_script() { byte[] ret = bindings.InvalidShutdownScript_get_script(this.ptr); @@ -34,7 +34,7 @@ public class InvalidShutdownScript extends CommonBase { /** * The script that did not meet the requirements from [BOLT #2]. * - * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md + * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md */ public void set_script(byte[] val) { bindings.InvalidShutdownScript_set_script(this.ptr, val); @@ -49,7 +49,7 @@ public class InvalidShutdownScript extends CommonBase { long ret = bindings.InvalidShutdownScript_new(script_arg); Reference.reachabilityFence(script_arg); if (ret >= 0 && ret <= 4096) { return null; } - InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvalidShutdownScript(null, ret); } + org.ldk.structs.InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvalidShutdownScript(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -67,7 +67,7 @@ public class InvalidShutdownScript extends CommonBase { long ret = bindings.InvalidShutdownScript_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvalidShutdownScript(null, ret); } + org.ldk.structs.InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvalidShutdownScript(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Invoice.java b/src/main/java/org/ldk/structs/Invoice.java index 3f209e3d..52ef2766 100644 --- a/src/main/java/org/ldk/structs/Invoice.java +++ b/src/main/java/org/ldk/structs/Invoice.java @@ -55,7 +55,7 @@ public class Invoice extends CommonBase { long ret = bindings.Invoice_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Invoice(null, ret); } + org.ldk.structs.Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Invoice(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -67,7 +67,7 @@ public class Invoice extends CommonBase { long ret = bindings.Invoice_into_signed_raw(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new SignedRawInvoice(null, ret); } + org.ldk.structs.SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SignedRawInvoice(null, ret); } ret_hu_conv.ptrs_to.add(this); ; return ret_hu_conv; @@ -172,7 +172,7 @@ public class Invoice extends CommonBase { long ret = bindings.Invoice_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); } + org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -235,7 +235,7 @@ public class Invoice extends CommonBase { PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret_conv_14_len]; for (int o = 0; o < ret_conv_14_len; o++) { long ret_conv_14 = ret[o]; - PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14); } + org.ldk.structs.PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new org.ldk.structs.PrivateRoute(null, ret_conv_14); } ret_conv_14_hu_conv.ptrs_to.add(this); ret_conv_14_arr[o] = ret_conv_14_hu_conv; } @@ -252,7 +252,7 @@ public class Invoice extends CommonBase { RouteHint[] ret_conv_11_arr = new RouteHint[ret_conv_11_len]; for (int l = 0; l < ret_conv_11_len; l++) { long ret_conv_11 = ret[l]; - RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new RouteHint(null, ret_conv_11); } + org.ldk.structs.RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new org.ldk.structs.RouteHint(null, ret_conv_11); } ret_conv_11_hu_conv.ptrs_to.add(this); ret_conv_11_arr[l] = ret_conv_11_hu_conv; } diff --git a/src/main/java/org/ldk/structs/InvoiceFeatures.java b/src/main/java/org/ldk/structs/InvoiceFeatures.java index 31bb70d1..c00bff60 100644 --- a/src/main/java/org/ldk/structs/InvoiceFeatures.java +++ b/src/main/java/org/ldk/structs/InvoiceFeatures.java @@ -50,7 +50,7 @@ public class InvoiceFeatures extends CommonBase { long ret = bindings.InvoiceFeatures_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); } + org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -61,7 +61,7 @@ public class InvoiceFeatures extends CommonBase { public static InvoiceFeatures empty() { long ret = bindings.InvoiceFeatures_empty(); if (ret >= 0 && ret <= 4096) { return null; } - InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); } + org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -72,7 +72,7 @@ public class InvoiceFeatures extends CommonBase { public static InvoiceFeatures known() { long ret = bindings.InvoiceFeatures_known(); if (ret >= 0 && ret <= 4096) { return null; } - InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); } + org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -107,4 +107,106 @@ public class InvoiceFeatures extends CommonBase { return ret_hu_conv; } + /** + * Set this feature as optional. + */ + public void set_variable_length_onion_optional() { + bindings.InvoiceFeatures_set_variable_length_onion_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_variable_length_onion_required() { + bindings.InvoiceFeatures_set_variable_length_onion_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_variable_length_onion() { + boolean ret = bindings.InvoiceFeatures_supports_variable_length_onion(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_variable_length_onion() { + boolean ret = bindings.InvoiceFeatures_requires_variable_length_onion(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_payment_secret_optional() { + bindings.InvoiceFeatures_set_payment_secret_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_payment_secret_required() { + bindings.InvoiceFeatures_set_payment_secret_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_payment_secret() { + boolean ret = bindings.InvoiceFeatures_supports_payment_secret(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_payment_secret() { + boolean ret = bindings.InvoiceFeatures_requires_payment_secret(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_basic_mpp_optional() { + bindings.InvoiceFeatures_set_basic_mpp_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_basic_mpp_required() { + bindings.InvoiceFeatures_set_basic_mpp_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_basic_mpp() { + boolean ret = bindings.InvoiceFeatures_supports_basic_mpp(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_basic_mpp() { + boolean ret = bindings.InvoiceFeatures_requires_basic_mpp(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/InvoicePayer.java b/src/main/java/org/ldk/structs/InvoicePayer.java index d8a7022e..e525e71a 100644 --- a/src/main/java/org/ldk/structs/InvoicePayer.java +++ b/src/main/java/org/ldk/structs/InvoicePayer.java @@ -28,18 +28,18 @@ public class InvoicePayer extends CommonBase { * Creates an invoice payer that retries failed payment paths. * * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once - * `retry_attempts` has been exceeded for a given [`Invoice`]. + * `retry` has been exceeded for a given [`Invoice`]. */ - public static InvoicePayer of(Payer payer, Router router, MultiThreadedLockableScore scorer, Logger logger, EventHandler event_handler, RetryAttempts retry_attempts) { - long ret = bindings.InvoicePayer_new(payer == null ? 0 : payer.ptr, router == null ? 0 : router.ptr, scorer == null ? 0 : scorer.ptr & ~1, logger == null ? 0 : logger.ptr, event_handler == null ? 0 : event_handler.ptr, retry_attempts == null ? 0 : retry_attempts.ptr & ~1); + public static InvoicePayer of(Payer payer, Router router, MultiThreadedLockableScore scorer, Logger logger, EventHandler event_handler, Retry retry) { + long ret = bindings.InvoicePayer_new(payer == null ? 0 : payer.ptr, router == null ? 0 : router.ptr, scorer == null ? 0 : scorer.ptr & ~1, logger == null ? 0 : logger.ptr, event_handler == null ? 0 : event_handler.ptr, retry.ptr); Reference.reachabilityFence(payer); Reference.reachabilityFence(router); Reference.reachabilityFence(scorer); Reference.reachabilityFence(logger); Reference.reachabilityFence(event_handler); - Reference.reachabilityFence(retry_attempts); + Reference.reachabilityFence(retry); if (ret >= 0 && ret <= 4096) { return null; } - InvoicePayer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoicePayer(null, ret); } + org.ldk.structs.InvoicePayer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoicePayer(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(payer); ret_hu_conv.ptrs_to.add(router); diff --git a/src/main/java/org/ldk/structs/InvoiceSignature.java b/src/main/java/org/ldk/structs/InvoiceSignature.java index 0d176c69..862e229c 100644 --- a/src/main/java/org/ldk/structs/InvoiceSignature.java +++ b/src/main/java/org/ldk/structs/InvoiceSignature.java @@ -33,7 +33,7 @@ public class InvoiceSignature extends CommonBase { long ret = bindings.InvoiceSignature_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceSignature(null, ret); } + org.ldk.structs.InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceSignature(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/KeysInterface.java b/src/main/java/org/ldk/structs/KeysInterface.java index 4fcc6010..fbaf6c85 100644 --- a/src/main/java/org/ldk/structs/KeysInterface.java +++ b/src/main/java/org/ldk/structs/KeysInterface.java @@ -192,7 +192,7 @@ public class KeysInterface extends CommonBase { long ret = bindings.KeysInterface_get_shutdown_scriptpubkey(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); } + org.ldk.structs.ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ShutdownScript(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/KeysManager.java b/src/main/java/org/ldk/structs/KeysManager.java index cb09143e..f5238499 100644 --- a/src/main/java/org/ldk/structs/KeysManager.java +++ b/src/main/java/org/ldk/structs/KeysManager.java @@ -59,7 +59,7 @@ public class KeysManager extends CommonBase { Reference.reachabilityFence(starting_time_secs); Reference.reachabilityFence(starting_time_nanos); if (ret >= 0 && ret <= 4096) { return null; } - KeysManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new KeysManager(null, ret); } + org.ldk.structs.KeysManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.KeysManager(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -77,7 +77,7 @@ public class KeysManager extends CommonBase { Reference.reachabilityFence(channel_value_satoshis); Reference.reachabilityFence(params); if (ret >= 0 && ret <= 4096) { return null; } - InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); } + org.ldk.structs.InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InMemorySigner(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/LightningError.java b/src/main/java/org/ldk/structs/LightningError.java index 9934b424..f323c111 100644 --- a/src/main/java/org/ldk/structs/LightningError.java +++ b/src/main/java/org/ldk/structs/LightningError.java @@ -67,7 +67,7 @@ public class LightningError extends CommonBase { Reference.reachabilityFence(err_arg); Reference.reachabilityFence(action_arg); if (ret >= 0 && ret <= 4096) { return null; } - LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new LightningError(null, ret); } + org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -85,7 +85,7 @@ public class LightningError extends CommonBase { long ret = bindings.LightningError_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new LightningError(null, ret); } + org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Listen.java b/src/main/java/org/ldk/structs/Listen.java index 8d597217..a74c118d 100644 --- a/src/main/java/org/ldk/structs/Listen.java +++ b/src/main/java/org/ldk/structs/Listen.java @@ -15,6 +15,10 @@ import javax.annotation.Nullable; * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`]. * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers * when needed. + * + * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the + * entire header chain and only blocks with matching transaction data using BIP 157 filters or + * other similar filtering. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Listen extends CommonBase { @@ -31,6 +35,11 @@ public class Listen extends CommonBase { } public static interface ListenInterface { + /** + * Notifies the listener that a block was added at the given height, with the transaction data + * possibly filtered. + */ + void filtered_block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height); /** * Notifies the listener that a block was added at the given height. */ @@ -44,6 +53,18 @@ public class Listen extends CommonBase { public static Listen new_impl(ListenInterface arg) { final LDKListenHolder impl_holder = new LDKListenHolder(); impl_holder.held = new Listen(new bindings.LDKListen() { + @Override public void filtered_block_connected(byte[] header, long[] txdata, int height) { + int txdata_conv_28_len = txdata.length; + TwoTuple_usizeTransactionZ[] txdata_conv_28_arr = new TwoTuple_usizeTransactionZ[txdata_conv_28_len]; + for (int c = 0; c < txdata_conv_28_len; c++) { + long txdata_conv_28 = txdata[c]; + TwoTuple_usizeTransactionZ txdata_conv_28_hu_conv = new TwoTuple_usizeTransactionZ(null, txdata_conv_28); + txdata_conv_28_hu_conv.ptrs_to.add(this); + txdata_conv_28_arr[c] = txdata_conv_28_hu_conv; + } + arg.filtered_block_connected(header, txdata_conv_28_arr, height); + Reference.reachabilityFence(arg); + } @Override public void block_connected(byte[] block, int height) { arg.block_connected(block, height); Reference.reachabilityFence(arg); @@ -55,6 +76,18 @@ public class Listen extends CommonBase { }); return impl_holder.held; } + /** + * Notifies the listener that a block was added at the given height, with the transaction data + * possibly filtered. + */ + public void filtered_block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height) { + bindings.Listen_filtered_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height); + Reference.reachabilityFence(this); + Reference.reachabilityFence(header); + Reference.reachabilityFence(txdata); + Reference.reachabilityFence(height); + } + /** * Notifies the listener that a block was added at the given height. */ diff --git a/src/main/java/org/ldk/structs/Logger.java b/src/main/java/org/ldk/structs/Logger.java index 04b6d020..0dc55222 100644 --- a/src/main/java/org/ldk/structs/Logger.java +++ b/src/main/java/org/ldk/structs/Logger.java @@ -35,7 +35,7 @@ public class Logger extends CommonBase { final LDKLoggerHolder impl_holder = new LDKLoggerHolder(); impl_holder.held = new Logger(new bindings.LDKLogger() { @Override public void log(long record) { - Record record_hu_conv = null; if (record < 0 || record > 4096) { record_hu_conv = new Record(null, record); } + org.ldk.structs.Record record_hu_conv = null; if (record < 0 || record > 4096) { record_hu_conv = new org.ldk.structs.Record(null, record); } arg.log(record_hu_conv); Reference.reachabilityFence(arg); } diff --git a/src/main/java/org/ldk/structs/MessageHandler.java b/src/main/java/org/ldk/structs/MessageHandler.java index 8d20a72e..fa4c4b21 100644 --- a/src/main/java/org/ldk/structs/MessageHandler.java +++ b/src/main/java/org/ldk/structs/MessageHandler.java @@ -50,10 +50,9 @@ public class MessageHandler extends CommonBase { /** * A message handler which handles messages updating our knowledge of the network channel - * graph. Usually this is just a [`NetGraphMsgHandler`] object or an - * [`IgnoringMessageHandler`]. + * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`]. * - * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler + * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync */ public RoutingMessageHandler get_route_handler() { long ret = bindings.MessageHandler_get_route_handler(this.ptr); @@ -66,10 +65,9 @@ public class MessageHandler extends CommonBase { /** * A message handler which handles messages updating our knowledge of the network channel - * graph. Usually this is just a [`NetGraphMsgHandler`] object or an - * [`IgnoringMessageHandler`]. + * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`]. * - * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler + * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync */ public void set_route_handler(RoutingMessageHandler val) { bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr); @@ -86,7 +84,7 @@ public class MessageHandler extends CommonBase { Reference.reachabilityFence(chan_handler_arg); Reference.reachabilityFence(route_handler_arg); if (ret >= 0 && ret <= 4096) { return null; } - MessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MessageHandler(null, ret); } + org.ldk.structs.MessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MessageHandler(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(chan_handler_arg); ret_hu_conv.ptrs_to.add(route_handler_arg); diff --git a/src/main/java/org/ldk/structs/MessageSendEvent.java b/src/main/java/org/ldk/structs/MessageSendEvent.java index 4d9633c1..0beba4e7 100644 --- a/src/main/java/org/ldk/structs/MessageSendEvent.java +++ b/src/main/java/org/ldk/structs/MessageSendEvent.java @@ -35,8 +35,8 @@ public class MessageSendEvent extends CommonBase { if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingSigned.class) { return new SendFundingSigned(ptr, (bindings.LDKMessageSendEvent.SendFundingSigned)raw_val); } - if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendFundingLocked.class) { - return new SendFundingLocked(ptr, (bindings.LDKMessageSendEvent.SendFundingLocked)raw_val); + if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendChannelReady.class) { + return new SendChannelReady(ptr, (bindings.LDKMessageSendEvent.SendChannelReady)raw_val); } if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendAnnouncementSignatures.class) { return new SendAnnouncementSignatures(ptr, (bindings.LDKMessageSendEvent.SendAnnouncementSignatures)raw_val); @@ -103,7 +103,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AcceptChannel(null, msg); } + org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -125,7 +125,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new OpenChannel(null, msg); } + org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -146,7 +146,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingCreated(null, msg); } + org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -167,28 +167,28 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingSigned(null, msg); } + org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } } /** - * Used to indicate that a funding_locked message should be sent to the peer with the given node_id. + * Used to indicate that a channel_ready message should be sent to the peer with the given node_id. */ - public final static class SendFundingLocked extends MessageSendEvent { + public final static class SendChannelReady extends MessageSendEvent { /** * The node_id of the node which should receive these message(s) */ public final byte[] node_id; /** - * The funding_locked message which should be sent. + * The channel_ready message which should be sent. */ - public final org.ldk.structs.FundingLocked msg; - private SendFundingLocked(long ptr, bindings.LDKMessageSendEvent.SendFundingLocked obj) { + public final org.ldk.structs.ChannelReady msg; + private SendChannelReady(long ptr, bindings.LDKMessageSendEvent.SendChannelReady obj) { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - FundingLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingLocked(null, msg); } + org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -209,7 +209,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AnnouncementSignatures(null, msg); } + org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -231,7 +231,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long updates = obj.updates; - CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new CommitmentUpdate(null, updates); } + org.ldk.structs.CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new org.ldk.structs.CommitmentUpdate(null, updates); } updates_hu_conv.ptrs_to.add(this); this.updates = updates_hu_conv; } @@ -252,7 +252,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new RevokeAndACK(null, msg); } + org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -273,7 +273,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ClosingSigned(null, msg); } + org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -294,7 +294,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Shutdown(null, msg); } + org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -315,7 +315,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelReestablish(null, msg); } + org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -342,11 +342,11 @@ public class MessageSendEvent extends CommonBase { private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) { super(null, ptr); long msg = obj.msg; - ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelAnnouncement(null, msg); } + org.ldk.structs.ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; long update_msg = obj.update_msg; - ChannelUpdate update_msg_hu_conv = null; if (update_msg < 0 || update_msg > 4096) { update_msg_hu_conv = new ChannelUpdate(null, update_msg); } + org.ldk.structs.ChannelUpdate update_msg_hu_conv = null; if (update_msg < 0 || update_msg > 4096) { update_msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, update_msg); } update_msg_hu_conv.ptrs_to.add(this); this.update_msg = update_msg_hu_conv; } @@ -362,7 +362,7 @@ public class MessageSendEvent extends CommonBase { private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) { super(null, ptr); long msg = obj.msg; - NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new NodeAnnouncement(null, msg); } + org.ldk.structs.NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -378,7 +378,7 @@ public class MessageSendEvent extends CommonBase { private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) { super(null, ptr); long msg = obj.msg; - ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); } + org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -401,7 +401,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); } + org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -443,7 +443,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryChannelRange(null, msg); } + org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -465,7 +465,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryShortChannelIds(null, msg); } + org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -487,7 +487,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyChannelRange(null, msg); } + org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -509,7 +509,7 @@ public class MessageSendEvent extends CommonBase { super(null, ptr); this.node_id = obj.node_id; long msg = obj.msg; - GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new GossipTimestampFilter(null, msg); } + org.ldk.structs.GossipTimestampFilter msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } @@ -585,10 +585,10 @@ public class MessageSendEvent extends CommonBase { } /** - * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent + * Utility method to constructs a new SendChannelReady-variant MessageSendEvent */ - public static MessageSendEvent send_funding_locked(byte[] node_id, FundingLocked msg) { - long ret = bindings.MessageSendEvent_send_funding_locked(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); + public static MessageSendEvent send_channel_ready(byte[] node_id, ChannelReady msg) { + long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java b/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java index 862cb9f1..13d6b31b 100644 --- a/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java +++ b/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java @@ -39,7 +39,7 @@ public class MinFinalCltvExpiry extends CommonBase { long ret = bindings.MinFinalCltvExpiry_new(a_arg); Reference.reachabilityFence(a_arg); if (ret >= 0 && ret <= 4096) { return null; } - MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MinFinalCltvExpiry(null, ret); } + org.ldk.structs.MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiry(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -57,7 +57,7 @@ public class MinFinalCltvExpiry extends CommonBase { long ret = bindings.MinFinalCltvExpiry_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MinFinalCltvExpiry(null, ret); } + org.ldk.structs.MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiry(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/MonitorEvent.java b/src/main/java/org/ldk/structs/MonitorEvent.java index 0beb6f64..46311a92 100644 --- a/src/main/java/org/ldk/structs/MonitorEvent.java +++ b/src/main/java/org/ldk/structs/MonitorEvent.java @@ -44,7 +44,7 @@ public class MonitorEvent extends CommonBase { private HTLCEvent(long ptr, bindings.LDKMonitorEvent.HTLCEvent obj) { super(null, ptr); long htlc_event = obj.htlc_event; - HTLCUpdate htlc_event_hu_conv = null; if (htlc_event < 0 || htlc_event > 4096) { htlc_event_hu_conv = new HTLCUpdate(null, htlc_event); } + org.ldk.structs.HTLCUpdate htlc_event_hu_conv = null; if (htlc_event < 0 || htlc_event > 4096) { htlc_event_hu_conv = new org.ldk.structs.HTLCUpdate(null, htlc_event); } htlc_event_hu_conv.ptrs_to.add(this); this.htlc_event = htlc_event_hu_conv; } @@ -57,7 +57,7 @@ public class MonitorEvent extends CommonBase { private CommitmentTxConfirmed(long ptr, bindings.LDKMonitorEvent.CommitmentTxConfirmed obj) { super(null, ptr); long commitment_tx_confirmed = obj.commitment_tx_confirmed; - OutPoint commitment_tx_confirmed_hu_conv = null; if (commitment_tx_confirmed < 0 || commitment_tx_confirmed > 4096) { commitment_tx_confirmed_hu_conv = new OutPoint(null, commitment_tx_confirmed); } + org.ldk.structs.OutPoint commitment_tx_confirmed_hu_conv = null; if (commitment_tx_confirmed < 0 || commitment_tx_confirmed > 4096) { commitment_tx_confirmed_hu_conv = new org.ldk.structs.OutPoint(null, commitment_tx_confirmed); } commitment_tx_confirmed_hu_conv.ptrs_to.add(this); this.commitment_tx_confirmed = commitment_tx_confirmed_hu_conv; } @@ -84,7 +84,7 @@ public class MonitorEvent extends CommonBase { private UpdateCompleted(long ptr, bindings.LDKMonitorEvent.UpdateCompleted obj) { super(null, ptr); long funding_txo = obj.funding_txo; - OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new OutPoint(null, funding_txo); } + org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); } funding_txo_hu_conv.ptrs_to.add(this); this.funding_txo = funding_txo_hu_conv; this.monitor_update_id = obj.monitor_update_id; @@ -101,7 +101,7 @@ public class MonitorEvent extends CommonBase { private UpdateFailed(long ptr, bindings.LDKMonitorEvent.UpdateFailed obj) { super(null, ptr); long update_failed = obj.update_failed; - OutPoint update_failed_hu_conv = null; if (update_failed < 0 || update_failed > 4096) { update_failed_hu_conv = new OutPoint(null, update_failed); } + org.ldk.structs.OutPoint update_failed_hu_conv = null; if (update_failed < 0 || update_failed > 4096) { update_failed_hu_conv = new org.ldk.structs.OutPoint(null, update_failed); } update_failed_hu_conv.ptrs_to.add(this); this.update_failed = update_failed_hu_conv; } diff --git a/src/main/java/org/ldk/structs/MonitorUpdateId.java b/src/main/java/org/ldk/structs/MonitorUpdateId.java index 89929f96..3f525e12 100644 --- a/src/main/java/org/ldk/structs/MonitorUpdateId.java +++ b/src/main/java/org/ldk/structs/MonitorUpdateId.java @@ -33,7 +33,7 @@ public class MonitorUpdateId extends CommonBase { long ret = bindings.MonitorUpdateId_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - MonitorUpdateId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MonitorUpdateId(null, ret); } + org.ldk.structs.MonitorUpdateId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MonitorUpdateId(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/MultiThreadedLockableScore.java b/src/main/java/org/ldk/structs/MultiThreadedLockableScore.java index 23eafa41..9386fde6 100644 --- a/src/main/java/org/ldk/structs/MultiThreadedLockableScore.java +++ b/src/main/java/org/ldk/structs/MultiThreadedLockableScore.java @@ -20,6 +20,15 @@ public class MultiThreadedLockableScore extends CommonBase { if (ptr != 0) { bindings.MultiThreadedLockableScore_free(ptr); } } + /** + * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read + */ + public byte[] write() { + byte[] ret = bindings.MultiThreadedLockableScore_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`]. */ @@ -27,7 +36,7 @@ public class MultiThreadedLockableScore extends CommonBase { long ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr); Reference.reachabilityFence(score); if (ret >= 0 && ret <= 4096) { return null; } - MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MultiThreadedLockableScore(null, ret); } + org.ldk.structs.MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MultiThreadedLockableScore(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(score); return ret_hu_conv; diff --git a/src/main/java/org/ldk/structs/NetworkGraph.java b/src/main/java/org/ldk/structs/NetworkGraph.java index 5159d8ae..e69a40b6 100644 --- a/src/main/java/org/ldk/structs/NetworkGraph.java +++ b/src/main/java/org/ldk/structs/NetworkGraph.java @@ -20,20 +20,15 @@ public class NetworkGraph extends CommonBase { if (ptr != 0) { bindings.NetworkGraph_free(ptr); } } - long clone_ptr() { - long ret = bindings.NetworkGraph_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - /** - * Creates a copy of the NetworkGraph + * Constructs a new EventHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is */ - public NetworkGraph clone() { - long ret = bindings.NetworkGraph_clone(this.ptr); + public EventHandler as_EventHandler() { + long ret = bindings.NetworkGraph_as_EventHandler(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NetworkGraph(null, ret); } + EventHandler ret_hu_conv = new EventHandler(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -50,23 +45,27 @@ public class NetworkGraph extends CommonBase { /** * Read a NetworkGraph from a byte array, created by NetworkGraph_write */ - public static Result_NetworkGraphDecodeErrorZ read(byte[] ser) { - long ret = bindings.NetworkGraph_read(ser); + public static Result_NetworkGraphDecodeErrorZ read(byte[] ser, Logger arg) { + long ret = bindings.NetworkGraph_read(ser, arg == null ? 0 : arg.ptr); Reference.reachabilityFence(ser); + Reference.reachabilityFence(arg); if (ret >= 0 && ret <= 4096) { return null; } Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(arg); return ret_hu_conv; } /** * Creates a new, empty, network graph. */ - public static NetworkGraph of(byte[] genesis_hash) { - long ret = bindings.NetworkGraph_new(InternalUtils.check_arr_len(genesis_hash, 32)); + public static NetworkGraph of(byte[] genesis_hash, Logger logger) { + long ret = bindings.NetworkGraph_new(InternalUtils.check_arr_len(genesis_hash, 32), logger == null ? 0 : logger.ptr); Reference.reachabilityFence(genesis_hash); + Reference.reachabilityFence(logger); if (ret >= 0 && ret <= 4096) { return null; } - NetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NetworkGraph(null, ret); } + org.ldk.structs.NetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NetworkGraph(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(logger); return ret_hu_conv; } @@ -77,16 +76,39 @@ public class NetworkGraph extends CommonBase { long ret = bindings.NetworkGraph_read_only(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ReadOnlyNetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReadOnlyNetworkGraph(null, ret); } + org.ldk.structs.ReadOnlyNetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReadOnlyNetworkGraph(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * The unix timestamp provided by the most recent rapid gossip sync. + * It will be set by the rapid sync process after every sync completion. + */ + public Option_u32Z get_last_rapid_gossip_sync_timestamp() { + long ret = bindings.NetworkGraph_get_last_rapid_gossip_sync_timestamp(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); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } + /** + * Update the unix timestamp provided by the most recent rapid gossip sync. + * This should be done automatically by the rapid sync process after every sync completion. + */ + public void set_last_rapid_gossip_sync_timestamp(int last_rapid_gossip_sync_timestamp) { + bindings.NetworkGraph_set_last_rapid_gossip_sync_timestamp(this.ptr, last_rapid_gossip_sync_timestamp); + Reference.reachabilityFence(this); + Reference.reachabilityFence(last_rapid_gossip_sync_timestamp); + } + /** * For an already known node (from channel announcements), update its stored properties from a * given node announcement. * - * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's + * You probably don't want to call this directly, instead relying on a P2PGossipSync's * 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. */ @@ -119,7 +141,7 @@ public class NetworkGraph extends CommonBase { /** * Store or update channel info from a channel announcement. * - * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's + * You probably don't want to call this directly, instead relying on a P2PGossipSync's * 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. * @@ -159,13 +181,34 @@ public class NetworkGraph extends CommonBase { } /** - * Close a channel if a corresponding HTLC fail was sent. + * Update channel from partial announcement data received via rapid gossip sync + * + * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the + * rapid gossip sync server) + * + * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields. + */ + public Result_NoneLightningErrorZ add_channel_from_partial_announcement(long short_channel_id, long timestamp, ChannelFeatures features, byte[] node_id_1, byte[] node_id_2) { + long ret = bindings.NetworkGraph_add_channel_from_partial_announcement(this.ptr, short_channel_id, timestamp, features == null ? 0 : features.ptr & ~1, InternalUtils.check_arr_len(node_id_1, 33), InternalUtils.check_arr_len(node_id_2, 33)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(short_channel_id); + Reference.reachabilityFence(timestamp); + Reference.reachabilityFence(features); + Reference.reachabilityFence(node_id_1); + Reference.reachabilityFence(node_id_2); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Marks a channel in the graph as failed if a corresponding HTLC fail was sent. * If permanent, removes a channel from the local storage. * May cause the removal of nodes too, if this was their last channel. * If not permanent, makes channels unavailable for routing. */ - public void close_channel_from_update(long short_channel_id, boolean is_permanent) { - bindings.NetworkGraph_close_channel_from_update(this.ptr, short_channel_id, is_permanent); + public void channel_failed(long short_channel_id, boolean is_permanent) { + bindings.NetworkGraph_channel_failed(this.ptr, short_channel_id, is_permanent); Reference.reachabilityFence(this); Reference.reachabilityFence(short_channel_id); Reference.reachabilityFence(is_permanent); @@ -174,8 +217,8 @@ public class NetworkGraph extends CommonBase { /** * Marks a node in the graph as failed. */ - public void fail_node(byte[] _node_id, boolean is_permanent) { - bindings.NetworkGraph_fail_node(this.ptr, InternalUtils.check_arr_len(_node_id, 33), is_permanent); + public void node_failed(byte[] _node_id, boolean is_permanent) { + bindings.NetworkGraph_node_failed(this.ptr, InternalUtils.check_arr_len(_node_id, 33), is_permanent); Reference.reachabilityFence(this); Reference.reachabilityFence(_node_id); Reference.reachabilityFence(is_permanent); @@ -223,7 +266,7 @@ public class NetworkGraph extends CommonBase { * For an already known (from announcement) channel, update info about one of the directions * of the channel. * - * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's + * You probably don't want to call this directly, instead relying on a P2PGossipSync's * 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. * diff --git a/src/main/java/org/ldk/structs/NetworkUpdate.java b/src/main/java/org/ldk/structs/NetworkUpdate.java index 0a85f072..8dff959e 100644 --- a/src/main/java/org/ldk/structs/NetworkUpdate.java +++ b/src/main/java/org/ldk/structs/NetworkUpdate.java @@ -12,7 +12,7 @@ import javax.annotation.Nullable; * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion * return packet by a node along the route. See [BOLT #4] for details. * - * [BOLT #4]: https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md + * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class NetworkUpdate extends CommonBase { @@ -27,8 +27,8 @@ public class NetworkUpdate extends CommonBase { if (raw_val.getClass() == bindings.LDKNetworkUpdate.ChannelUpdateMessage.class) { return new ChannelUpdateMessage(ptr, (bindings.LDKNetworkUpdate.ChannelUpdateMessage)raw_val); } - if (raw_val.getClass() == bindings.LDKNetworkUpdate.ChannelClosed.class) { - return new ChannelClosed(ptr, (bindings.LDKNetworkUpdate.ChannelClosed)raw_val); + if (raw_val.getClass() == bindings.LDKNetworkUpdate.ChannelFailure.class) { + return new ChannelFailure(ptr, (bindings.LDKNetworkUpdate.ChannelFailure)raw_val); } if (raw_val.getClass() == bindings.LDKNetworkUpdate.NodeFailure.class) { return new NodeFailure(ptr, (bindings.LDKNetworkUpdate.NodeFailure)raw_val); @@ -48,16 +48,16 @@ public class NetworkUpdate extends CommonBase { private ChannelUpdateMessage(long ptr, bindings.LDKNetworkUpdate.ChannelUpdateMessage obj) { super(null, ptr); long msg = obj.msg; - ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); } + org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); } msg_hu_conv.ptrs_to.add(this); this.msg = msg_hu_conv; } } /** - * An error indicating only that a channel has been closed, which should be applied via - * [`NetworkGraph::close_channel_from_update`]. + * An error indicating that a channel failed to route a payment, which should be applied via + * [`NetworkGraph::channel_failed`]. */ - public final static class ChannelClosed extends NetworkUpdate { + public final static class ChannelFailure extends NetworkUpdate { /** * The short channel id of the closed channel. */ @@ -67,15 +67,15 @@ public class NetworkUpdate extends CommonBase { * `channel_update` message is received. */ public final boolean is_permanent; - private ChannelClosed(long ptr, bindings.LDKNetworkUpdate.ChannelClosed obj) { + private ChannelFailure(long ptr, bindings.LDKNetworkUpdate.ChannelFailure obj) { super(null, ptr); this.short_channel_id = obj.short_channel_id; this.is_permanent = obj.is_permanent; } } /** - * An error indicating only that a node has failed, which should be applied via - * [`NetworkGraph::fail_node`]. + * An error indicating that a node failed to route a payment, which should be applied via + * [`NetworkGraph::node_failed`]. */ public final static class NodeFailure extends NetworkUpdate { /** @@ -124,10 +124,10 @@ public class NetworkUpdate extends CommonBase { } /** - * Utility method to constructs a new ChannelClosed-variant NetworkUpdate + * Utility method to constructs a new ChannelFailure-variant NetworkUpdate */ - public static NetworkUpdate channel_closed(long short_channel_id, boolean is_permanent) { - long ret = bindings.NetworkUpdate_channel_closed(short_channel_id, is_permanent); + public static NetworkUpdate channel_failure(long short_channel_id, boolean is_permanent) { + long ret = bindings.NetworkUpdate_channel_failure(short_channel_id, is_permanent); Reference.reachabilityFence(short_channel_id); Reference.reachabilityFence(is_permanent); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/NodeAnnouncement.java b/src/main/java/org/ldk/structs/NodeAnnouncement.java index 7168cde2..89be8364 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncement.java @@ -45,7 +45,7 @@ public class NodeAnnouncement extends CommonBase { long ret = bindings.NodeAnnouncement_get_contents(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); } + org.ldk.structs.UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedNodeAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -67,7 +67,7 @@ public class NodeAnnouncement extends CommonBase { Reference.reachabilityFence(signature_arg); Reference.reachabilityFence(contents_arg); if (ret >= 0 && ret <= 4096) { return null; } - NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncement(null, ret); } + org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -85,7 +85,7 @@ public class NodeAnnouncement extends CommonBase { long ret = bindings.NodeAnnouncement_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncement(null, ret); } + org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java index 765463f9..4cd07e74 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java @@ -27,7 +27,7 @@ public class NodeAnnouncementInfo extends CommonBase { long ret = bindings.NodeAnnouncementInfo_get_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -123,7 +123,7 @@ public class NodeAnnouncementInfo extends CommonBase { long ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncement(null, ret); } + org.ldk.structs.NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -154,7 +154,7 @@ public class NodeAnnouncementInfo extends CommonBase { Reference.reachabilityFence(addresses_arg); Reference.reachabilityFence(announcement_message_arg); if (ret >= 0 && ret <= 4096) { return null; } - NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncementInfo(null, ret); } + org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -172,7 +172,7 @@ public class NodeAnnouncementInfo extends CommonBase { long ret = bindings.NodeAnnouncementInfo_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncementInfo(null, ret); } + org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/NodeFeatures.java b/src/main/java/org/ldk/structs/NodeFeatures.java index 6eeba7fb..cc35182f 100644 --- a/src/main/java/org/ldk/structs/NodeFeatures.java +++ b/src/main/java/org/ldk/structs/NodeFeatures.java @@ -50,7 +50,7 @@ public class NodeFeatures extends CommonBase { long ret = bindings.NodeFeatures_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -61,7 +61,7 @@ public class NodeFeatures extends CommonBase { public static NodeFeatures empty() { long ret = bindings.NodeFeatures_empty(); if (ret >= 0 && ret <= 4096) { return null; } - NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -72,7 +72,7 @@ public class NodeFeatures extends CommonBase { public static NodeFeatures known() { long ret = bindings.NodeFeatures_known(); if (ret >= 0 && ret <= 4096) { return null; } - NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -107,4 +107,446 @@ public class NodeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Set this feature as optional. + */ + public void set_data_loss_protect_optional() { + bindings.NodeFeatures_set_data_loss_protect_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_data_loss_protect_required() { + bindings.NodeFeatures_set_data_loss_protect_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_data_loss_protect() { + boolean ret = bindings.NodeFeatures_supports_data_loss_protect(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_data_loss_protect() { + boolean ret = bindings.NodeFeatures_requires_data_loss_protect(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_upfront_shutdown_script_optional() { + bindings.NodeFeatures_set_upfront_shutdown_script_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_upfront_shutdown_script_required() { + bindings.NodeFeatures_set_upfront_shutdown_script_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_upfront_shutdown_script() { + boolean ret = bindings.NodeFeatures_supports_upfront_shutdown_script(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_upfront_shutdown_script() { + boolean ret = bindings.NodeFeatures_requires_upfront_shutdown_script(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_gossip_queries_optional() { + bindings.NodeFeatures_set_gossip_queries_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_gossip_queries_required() { + bindings.NodeFeatures_set_gossip_queries_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_gossip_queries() { + boolean ret = bindings.NodeFeatures_supports_gossip_queries(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_gossip_queries() { + boolean ret = bindings.NodeFeatures_requires_gossip_queries(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_variable_length_onion_optional() { + bindings.NodeFeatures_set_variable_length_onion_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_variable_length_onion_required() { + bindings.NodeFeatures_set_variable_length_onion_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_variable_length_onion() { + boolean ret = bindings.NodeFeatures_supports_variable_length_onion(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_variable_length_onion() { + boolean ret = bindings.NodeFeatures_requires_variable_length_onion(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_static_remote_key_optional() { + bindings.NodeFeatures_set_static_remote_key_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_static_remote_key_required() { + bindings.NodeFeatures_set_static_remote_key_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_static_remote_key() { + boolean ret = bindings.NodeFeatures_supports_static_remote_key(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_static_remote_key() { + boolean ret = bindings.NodeFeatures_requires_static_remote_key(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_payment_secret_optional() { + bindings.NodeFeatures_set_payment_secret_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_payment_secret_required() { + bindings.NodeFeatures_set_payment_secret_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_payment_secret() { + boolean ret = bindings.NodeFeatures_supports_payment_secret(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_payment_secret() { + boolean ret = bindings.NodeFeatures_requires_payment_secret(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_basic_mpp_optional() { + bindings.NodeFeatures_set_basic_mpp_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_basic_mpp_required() { + bindings.NodeFeatures_set_basic_mpp_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_basic_mpp() { + boolean ret = bindings.NodeFeatures_supports_basic_mpp(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_basic_mpp() { + boolean ret = bindings.NodeFeatures_requires_basic_mpp(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_wumbo_optional() { + bindings.NodeFeatures_set_wumbo_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_wumbo_required() { + bindings.NodeFeatures_set_wumbo_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_wumbo() { + boolean ret = bindings.NodeFeatures_supports_wumbo(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_wumbo() { + boolean ret = bindings.NodeFeatures_requires_wumbo(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_shutdown_any_segwit_optional() { + bindings.NodeFeatures_set_shutdown_any_segwit_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_shutdown_any_segwit_required() { + bindings.NodeFeatures_set_shutdown_any_segwit_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_shutdown_anysegwit() { + boolean ret = bindings.NodeFeatures_supports_shutdown_anysegwit(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_shutdown_anysegwit() { + boolean ret = bindings.NodeFeatures_requires_shutdown_anysegwit(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_channel_type_optional() { + bindings.NodeFeatures_set_channel_type_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_channel_type_required() { + bindings.NodeFeatures_set_channel_type_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_channel_type() { + boolean ret = bindings.NodeFeatures_supports_channel_type(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_channel_type() { + boolean ret = bindings.NodeFeatures_requires_channel_type(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_scid_privacy_optional() { + bindings.NodeFeatures_set_scid_privacy_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_scid_privacy_required() { + bindings.NodeFeatures_set_scid_privacy_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_scid_privacy() { + boolean ret = bindings.NodeFeatures_supports_scid_privacy(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_scid_privacy() { + boolean ret = bindings.NodeFeatures_requires_scid_privacy(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_zero_conf_optional() { + bindings.NodeFeatures_set_zero_conf_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_zero_conf_required() { + bindings.NodeFeatures_set_zero_conf_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_zero_conf() { + boolean ret = bindings.NodeFeatures_supports_zero_conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_zero_conf() { + boolean ret = bindings.NodeFeatures_requires_zero_conf(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Set this feature as optional. + */ + public void set_keysend_optional() { + bindings.NodeFeatures_set_keysend_optional(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Set this feature as required. + */ + public void set_keysend_required() { + bindings.NodeFeatures_set_keysend_required(this.ptr); + Reference.reachabilityFence(this); + } + + /** + * Checks if this feature is supported. + */ + public boolean supports_keysend() { + boolean ret = bindings.NodeFeatures_supports_keysend(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public boolean requires_keysend() { + boolean ret = bindings.NodeFeatures_requires_keysend(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + } diff --git a/src/main/java/org/ldk/structs/NodeId.java b/src/main/java/org/ldk/structs/NodeId.java index 354a619f..ead181e9 100644 --- a/src/main/java/org/ldk/structs/NodeId.java +++ b/src/main/java/org/ldk/structs/NodeId.java @@ -33,7 +33,7 @@ public class NodeId extends CommonBase { long ret = bindings.NodeId_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -45,7 +45,7 @@ public class NodeId extends CommonBase { long ret = bindings.NodeId_from_pubkey(InternalUtils.check_arr_len(pubkey, 33)); Reference.reachabilityFence(pubkey); if (ret >= 0 && ret <= 4096) { return null; } - NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/NodeInfo.java b/src/main/java/org/ldk/structs/NodeInfo.java index 803f8e69..ea3a8654 100644 --- a/src/main/java/org/ldk/structs/NodeInfo.java +++ b/src/main/java/org/ldk/structs/NodeInfo.java @@ -41,7 +41,7 @@ public class NodeInfo extends CommonBase { long ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); } + org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -71,7 +71,7 @@ public class NodeInfo extends CommonBase { long ret = bindings.NodeInfo_get_announcement_info(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncementInfo(null, ret); } + org.ldk.structs.NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -98,7 +98,7 @@ public class NodeInfo extends CommonBase { Reference.reachabilityFence(lowest_inbound_channel_fees_arg); Reference.reachabilityFence(announcement_info_arg); if (ret >= 0 && ret <= 4096) { return null; } - NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeInfo(null, ret); } + org.ldk.structs.NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeInfo(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -116,7 +116,7 @@ public class NodeInfo extends CommonBase { long ret = bindings.NodeInfo_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeInfo(null, ret); } + org.ldk.structs.NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeInfo(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/OpenChannel.java b/src/main/java/org/ldk/structs/OpenChannel.java index 5d4e8870..3a77bc2f 100644 --- a/src/main/java/org/ldk/structs/OpenChannel.java +++ b/src/main/java/org/ldk/structs/OpenChannel.java @@ -356,7 +356,7 @@ public class OpenChannel extends CommonBase { long ret = bindings.OpenChannel_get_channel_type(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -387,7 +387,7 @@ public class OpenChannel extends CommonBase { long ret = bindings.OpenChannel_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OpenChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OpenChannel(null, ret); } + org.ldk.structs.OpenChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannel(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java b/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java index 2dd9b7ed..39b91086 100644 --- a/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java +++ b/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; /** - * An enum which can either contain a crate::lightning::routing::network_graph::NetworkUpdate or not + * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Option_NetworkUpdateZ extends CommonBase { @@ -31,7 +31,7 @@ public class Option_NetworkUpdateZ extends CommonBase { } /** - * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::network_graph::NetworkUpdate + * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate */ public final static class Some extends Option_NetworkUpdateZ { public final org.ldk.structs.NetworkUpdate some; @@ -52,7 +52,7 @@ public class Option_NetworkUpdateZ extends CommonBase { } } /** - * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::network_graph::NetworkUpdate + * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate */ public static Option_NetworkUpdateZ some(NetworkUpdate o) { long ret = bindings.COption_NetworkUpdateZ_some(o.ptr); diff --git a/src/main/java/org/ldk/structs/OutPoint.java b/src/main/java/org/ldk/structs/OutPoint.java index 5d6390e7..6a51baf0 100644 --- a/src/main/java/org/ldk/structs/OutPoint.java +++ b/src/main/java/org/ldk/structs/OutPoint.java @@ -67,7 +67,7 @@ public class OutPoint extends CommonBase { Reference.reachabilityFence(txid_arg); Reference.reachabilityFence(index_arg); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -85,7 +85,7 @@ public class OutPoint extends CommonBase { long ret = bindings.OutPoint_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java b/src/main/java/org/ldk/structs/P2PGossipSync.java similarity index 68% rename from src/main/java/org/ldk/structs/NetGraphMsgHandler.java rename to src/main/java/org/ldk/structs/P2PGossipSync.java index 2236f5bc..93f1c69d 100644 --- a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java +++ b/src/main/java/org/ldk/structs/P2PGossipSync.java @@ -19,25 +19,12 @@ import javax.annotation.Nullable; * [`NetworkGraph`]. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class NetGraphMsgHandler extends CommonBase { - NetGraphMsgHandler(Object _dummy, long ptr) { super(ptr); } +public class P2PGossipSync extends CommonBase { + P2PGossipSync(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - if (ptr != 0) { bindings.NetGraphMsgHandler_free(ptr); } - } - - /** - * Constructs a new EventHandler which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is - */ - public EventHandler as_EventHandler() { - long ret = bindings.NetGraphMsgHandler_as_EventHandler(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - EventHandler ret_hu_conv = new EventHandler(null, ret); - ret_hu_conv.ptrs_to.add(this); - return ret_hu_conv; + if (ptr != 0) { bindings.P2PGossipSync_free(ptr); } } /** @@ -47,13 +34,13 @@ public class NetGraphMsgHandler extends CommonBase { * channel data is correct, and that the announcement is signed with * channel owners' keys. */ - public static NetGraphMsgHandler of(NetworkGraph network_graph, Option_AccessZ chain_access, Logger logger) { - long ret = bindings.NetGraphMsgHandler_new(network_graph == null ? 0 : network_graph.ptr & ~1, chain_access.ptr, logger == null ? 0 : logger.ptr); + public static P2PGossipSync of(NetworkGraph network_graph, Option_AccessZ chain_access, Logger logger) { + long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr & ~1, chain_access.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(network_graph); Reference.reachabilityFence(chain_access); Reference.reachabilityFence(logger); if (ret >= 0 && ret <= 4096) { return null; } - NetGraphMsgHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NetGraphMsgHandler(null, ret); } + org.ldk.structs.P2PGossipSync ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.P2PGossipSync(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(network_graph); ret_hu_conv.ptrs_to.add(chain_access); @@ -67,7 +54,7 @@ public class NetGraphMsgHandler extends CommonBase { * Add, update or remove the provider would replace the current one. */ public void add_chain_access(Option_AccessZ chain_access) { - bindings.NetGraphMsgHandler_add_chain_access(this.ptr, chain_access.ptr); + bindings.P2PGossipSync_add_chain_access(this.ptr, chain_access.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(chain_access); this.ptrs_to.add(chain_access); @@ -78,7 +65,7 @@ public class NetGraphMsgHandler extends CommonBase { * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is */ public RoutingMessageHandler as_RoutingMessageHandler() { - long ret = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(this.ptr); + long ret = bindings.P2PGossipSync_as_RoutingMessageHandler(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret); @@ -91,7 +78,7 @@ public class NetGraphMsgHandler extends CommonBase { * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is */ public MessageSendEventsProvider as_MessageSendEventsProvider() { - long ret = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr); + long ret = bindings.P2PGossipSync_as_MessageSendEventsProvider(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret); diff --git a/src/main/java/org/ldk/structs/PayeePubKey.java b/src/main/java/org/ldk/structs/PayeePubKey.java index edcadd5e..e08c4887 100644 --- a/src/main/java/org/ldk/structs/PayeePubKey.java +++ b/src/main/java/org/ldk/structs/PayeePubKey.java @@ -39,7 +39,7 @@ public class PayeePubKey extends CommonBase { long ret = bindings.PayeePubKey_new(InternalUtils.check_arr_len(a_arg, 33)); Reference.reachabilityFence(a_arg); if (ret >= 0 && ret <= 4096) { return null; } - PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); } + org.ldk.structs.PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PayeePubKey(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -57,7 +57,7 @@ public class PayeePubKey extends CommonBase { long ret = bindings.PayeePubKey_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); } + org.ldk.structs.PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PayeePubKey(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Payer.java b/src/main/java/org/ldk/structs/Payer.java index e34ad9d2..9b0375fb 100644 --- a/src/main/java/org/ldk/structs/Payer.java +++ b/src/main/java/org/ldk/structs/Payer.java @@ -69,21 +69,21 @@ public class Payer extends CommonBase { return result; } @Override public long send_payment(long route, byte[] payment_hash, byte[] payment_secret) { - Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new Route(null, route); } + org.ldk.structs.Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new org.ldk.structs.Route(null, route); } Result_PaymentIdPaymentSendFailureZ ret = arg.send_payment(route_hu_conv, payment_hash, payment_secret); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long send_spontaneous_payment(long route, byte[] payment_preimage) { - Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new Route(null, route); } + org.ldk.structs.Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new org.ldk.structs.Route(null, route); } Result_PaymentIdPaymentSendFailureZ ret = arg.send_spontaneous_payment(route_hu_conv, payment_preimage); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long retry_payment(long route, byte[] payment_id) { - Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new Route(null, route); } + org.ldk.structs.Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new org.ldk.structs.Route(null, route); } Result_NonePaymentSendFailureZ ret = arg.retry_payment(route_hu_conv, payment_id); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); @@ -115,7 +115,7 @@ public class Payer extends CommonBase { ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret_conv_16_len]; for (int q = 0; q < ret_conv_16_len; q++) { long ret_conv_16 = ret[q]; - ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16); } + org.ldk.structs.ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, ret_conv_16); } ret_conv_16_hu_conv.ptrs_to.add(this); ret_conv_16_arr[q] = ret_conv_16_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PaymentError.java b/src/main/java/org/ldk/structs/PaymentError.java index 95f9705a..458abea8 100644 --- a/src/main/java/org/ldk/structs/PaymentError.java +++ b/src/main/java/org/ldk/structs/PaymentError.java @@ -51,7 +51,7 @@ public class PaymentError extends CommonBase { private Routing(long ptr, bindings.LDKPaymentError.Routing obj) { super(null, ptr); long routing = obj.routing; - LightningError routing_hu_conv = null; if (routing < 0 || routing > 4096) { routing_hu_conv = new LightningError(null, routing); } + org.ldk.structs.LightningError routing_hu_conv = null; if (routing < 0 || routing > 4096) { routing_hu_conv = new org.ldk.structs.LightningError(null, routing); } routing_hu_conv.ptrs_to.add(this); this.routing = routing_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PaymentParameters.java b/src/main/java/org/ldk/structs/PaymentParameters.java index 7baa07ce..d4cea742 100644 --- a/src/main/java/org/ldk/structs/PaymentParameters.java +++ b/src/main/java/org/ldk/structs/PaymentParameters.java @@ -53,7 +53,7 @@ public class PaymentParameters extends CommonBase { long ret = bindings.PaymentParameters_get_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); } + org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -84,7 +84,7 @@ public class PaymentParameters extends CommonBase { RouteHint[] ret_conv_11_arr = new RouteHint[ret_conv_11_len]; for (int l = 0; l < ret_conv_11_len; l++) { long ret_conv_11 = ret[l]; - RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new RouteHint(null, ret_conv_11); } + org.ldk.structs.RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new org.ldk.structs.RouteHint(null, ret_conv_11); } ret_conv_11_hu_conv.ptrs_to.add(this); ret_conv_11_arr[l] = ret_conv_11_hu_conv; } @@ -150,7 +150,7 @@ public class PaymentParameters extends CommonBase { Reference.reachabilityFence(expiry_time_arg); Reference.reachabilityFence(max_total_cltv_expiry_delta_arg); if (ret >= 0 && ret <= 4096) { return null; } - PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PaymentParameters(null, ret); } + org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -168,7 +168,7 @@ public class PaymentParameters extends CommonBase { long ret = bindings.PaymentParameters_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PaymentParameters(null, ret); } + org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -229,7 +229,7 @@ public class PaymentParameters extends CommonBase { long ret = bindings.PaymentParameters_from_node_id(InternalUtils.check_arr_len(payee_pubkey, 33)); Reference.reachabilityFence(payee_pubkey); if (ret >= 0 && ret <= 4096) { return null; } - PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PaymentParameters(null, ret); } + org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -241,7 +241,7 @@ public class PaymentParameters extends CommonBase { long ret = bindings.PaymentParameters_for_keysend(InternalUtils.check_arr_len(payee_pubkey, 33)); Reference.reachabilityFence(payee_pubkey); if (ret >= 0 && ret <= 4096) { return null; } - PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PaymentParameters(null, ret); } + org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PaymentPurpose.java b/src/main/java/org/ldk/structs/PaymentPurpose.java index 50412c60..276e8895 100644 --- a/src/main/java/org/ldk/structs/PaymentPurpose.java +++ b/src/main/java/org/ldk/structs/PaymentPurpose.java @@ -119,4 +119,24 @@ public class PaymentPurpose extends CommonBase { return ret_hu_conv; } + /** + * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read + */ + public byte[] write() { + byte[] ret = bindings.PaymentPurpose_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write + */ + public static Result_PaymentPurposeDecodeErrorZ read(byte[] ser) { + long ret = bindings.PaymentPurpose_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/PaymentSendFailure.java b/src/main/java/org/ldk/structs/PaymentSendFailure.java index 69375c1f..85d5d7ca 100644 --- a/src/main/java/org/ldk/structs/PaymentSendFailure.java +++ b/src/main/java/org/ldk/structs/PaymentSendFailure.java @@ -141,7 +141,7 @@ public class PaymentSendFailure extends CommonBase { } this.results = results_conv_22_arr; long failed_paths_retry = obj.failed_paths_retry; - RouteParameters failed_paths_retry_hu_conv = null; if (failed_paths_retry < 0 || failed_paths_retry > 4096) { failed_paths_retry_hu_conv = new RouteParameters(null, 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); } failed_paths_retry_hu_conv.ptrs_to.add(this); this.failed_paths_retry = failed_paths_retry_hu_conv; this.payment_id = obj.payment_id; diff --git a/src/main/java/org/ldk/structs/PeerHandleError.java b/src/main/java/org/ldk/structs/PeerHandleError.java index e9dda3f2..793d3ff3 100644 --- a/src/main/java/org/ldk/structs/PeerHandleError.java +++ b/src/main/java/org/ldk/structs/PeerHandleError.java @@ -23,8 +23,13 @@ public class PeerHandleError extends CommonBase { } /** - * Used to indicate that we probably can't make any future connections to this peer, implying - * we should go ahead and force-close any channels we have with it. + * Used to indicate that we probably can't make any future connections to this peer (e.g. + * because we required features that our peer was missing, or vice versa). + * + * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close + * any channels with this peer or check for new versions of LDK. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public boolean get_no_connection_possible() { boolean ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr); @@ -33,8 +38,13 @@ public class PeerHandleError extends CommonBase { } /** - * Used to indicate that we probably can't make any future connections to this peer, implying - * we should go ahead and force-close any channels we have with it. + * Used to indicate that we probably can't make any future connections to this peer (e.g. + * because we required features that our peer was missing, or vice versa). + * + * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close + * any channels with this peer or check for new versions of LDK. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public void set_no_connection_possible(boolean val) { bindings.PeerHandleError_set_no_connection_possible(this.ptr, val); @@ -49,7 +59,7 @@ public class PeerHandleError extends CommonBase { long ret = bindings.PeerHandleError_new(no_connection_possible_arg); Reference.reachabilityFence(no_connection_possible_arg); if (ret >= 0 && ret <= 4096) { return null; } - PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); } + org.ldk.structs.PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerHandleError(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -67,7 +77,7 @@ public class PeerHandleError extends CommonBase { long ret = bindings.PeerHandleError_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); } + org.ldk.structs.PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerHandleError(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PeerManager.java b/src/main/java/org/ldk/structs/PeerManager.java index e41024f8..4fad6787 100644 --- a/src/main/java/org/ldk/structs/PeerManager.java +++ b/src/main/java/org/ldk/structs/PeerManager.java @@ -52,7 +52,7 @@ public class PeerManager extends CommonBase { Reference.reachabilityFence(logger); Reference.reachabilityFence(custom_message_handler); if (ret >= 0 && ret <= 4096) { return null; } - PeerManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerManager(null, ret); } + org.ldk.structs.PeerManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerManager(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(message_handler_chan_handler_arg); ret_hu_conv.ptrs_to.add(message_handler_route_handler_arg); @@ -193,6 +193,10 @@ public class PeerManager extends CommonBase { * 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. * + * 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 + * other calls return. + * * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards * [`send_data`]: SocketDescriptor::send_data diff --git a/src/main/java/org/ldk/structs/Persist.java b/src/main/java/org/ldk/structs/Persist.java index 707f359f..99d94028 100644 --- a/src/main/java/org/ldk/structs/Persist.java +++ b/src/main/java/org/ldk/structs/Persist.java @@ -105,10 +105,10 @@ public class Persist extends CommonBase { final LDKPersistHolder impl_holder = new LDKPersistHolder(); impl_holder.held = new Persist(new bindings.LDKPersist() { @Override public long persist_new_channel(long channel_id, long data, long update_id) { - OutPoint channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new OutPoint(null, channel_id); } + org.ldk.structs.OutPoint channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.OutPoint(null, channel_id); } channel_id_hu_conv.ptrs_to.add(this); - ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new ChannelMonitor(null, data); } - MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new MonitorUpdateId(null, update_id); } + org.ldk.structs.ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new org.ldk.structs.ChannelMonitor(null, data); } + org.ldk.structs.MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new org.ldk.structs.MonitorUpdateId(null, update_id); } update_id_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(channel_id_hu_conv, data_hu_conv, update_id_hu_conv); Reference.reachabilityFence(arg); @@ -116,11 +116,11 @@ public class Persist extends CommonBase { return result; } @Override public long update_persisted_channel(long channel_id, long update, long data, long update_id) { - OutPoint channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new OutPoint(null, channel_id); } + org.ldk.structs.OutPoint channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.OutPoint(null, channel_id); } channel_id_hu_conv.ptrs_to.add(this); - ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new ChannelMonitorUpdate(null, update); } - ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new ChannelMonitor(null, data); } - MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new MonitorUpdateId(null, update_id); } + org.ldk.structs.ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, update); } + org.ldk.structs.ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new org.ldk.structs.ChannelMonitor(null, data); } + org.ldk.structs.MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new org.ldk.structs.MonitorUpdateId(null, update_id); } update_id_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(channel_id_hu_conv, update_hu_conv, data_hu_conv, update_id_hu_conv); Reference.reachabilityFence(arg); diff --git a/src/main/java/org/ldk/structs/Persister.java b/src/main/java/org/ldk/structs/Persister.java index d8ffc858..059d1c74 100644 --- a/src/main/java/org/ldk/structs/Persister.java +++ b/src/main/java/org/ldk/structs/Persister.java @@ -8,7 +8,7 @@ import java.lang.ref.Reference; import javax.annotation.Nullable; /** - * Trait that handles persisting a [`ChannelManager`] and [`NetworkGraph`] to disk. + * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`MultiThreadedLockableScore`] to disk. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Persister extends CommonBase { @@ -26,39 +26,48 @@ public class Persister extends CommonBase { public static interface PersisterInterface { /** - * Persist the given [`ChannelManager`] to disk, returning an error if persistence failed - * (which will cause the [`BackgroundProcessor`] which called this method to exit). + * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed. */ Result_NoneErrorZ persist_manager(ChannelManager channel_manager); /** * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed. */ Result_NoneErrorZ persist_graph(NetworkGraph network_graph); + /** + * Persist the given [`MultiThreadedLockableScore`] to disk, returning an error if persistence failed. + */ + Result_NoneErrorZ persist_scorer(MultiThreadedLockableScore scorer); } private static class LDKPersisterHolder { Persister held; } public static Persister new_impl(PersisterInterface arg) { final LDKPersisterHolder impl_holder = new LDKPersisterHolder(); impl_holder.held = new Persister(new bindings.LDKPersister() { @Override public long persist_manager(long channel_manager) { - ChannelManager channel_manager_hu_conv = null; if (channel_manager < 0 || channel_manager > 4096) { channel_manager_hu_conv = new ChannelManager(null, channel_manager); } + org.ldk.structs.ChannelManager channel_manager_hu_conv = null; if (channel_manager < 0 || channel_manager > 4096) { channel_manager_hu_conv = new org.ldk.structs.ChannelManager(null, channel_manager); } Result_NoneErrorZ ret = arg.persist_manager(channel_manager_hu_conv); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long persist_graph(long network_graph) { - NetworkGraph network_graph_hu_conv = null; if (network_graph < 0 || network_graph > 4096) { network_graph_hu_conv = new NetworkGraph(null, network_graph); } + org.ldk.structs.NetworkGraph network_graph_hu_conv = null; if (network_graph < 0 || network_graph > 4096) { network_graph_hu_conv = new org.ldk.structs.NetworkGraph(null, network_graph); } Result_NoneErrorZ ret = arg.persist_graph(network_graph_hu_conv); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } + @Override public long persist_scorer(long scorer) { + org.ldk.structs.MultiThreadedLockableScore scorer_hu_conv = null; if (scorer < 0 || scorer > 4096) { scorer_hu_conv = new org.ldk.structs.MultiThreadedLockableScore(null, scorer); } + Result_NoneErrorZ ret = arg.persist_scorer(scorer_hu_conv); + Reference.reachabilityFence(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } }); return impl_holder.held; } /** - * Persist the given [`ChannelManager`] to disk, returning an error if persistence failed - * (which will cause the [`BackgroundProcessor`] which called this method to exit). + * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed. */ public Result_NoneErrorZ persist_manager(ChannelManager channel_manager) { long ret = bindings.Persister_persist_manager(this.ptr, channel_manager == null ? 0 : channel_manager.ptr & ~1); @@ -83,4 +92,17 @@ public class Persister extends CommonBase { return ret_hu_conv; } + /** + * Persist the given [`MultiThreadedLockableScore`] to disk, returning an error if persistence failed. + */ + public Result_NoneErrorZ persist_scorer(MultiThreadedLockableScore scorer) { + long ret = bindings.Persister_persist_scorer(this.ptr, scorer == null ? 0 : scorer.ptr & ~1); + Reference.reachabilityFence(this); + Reference.reachabilityFence(scorer); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret); + this.ptrs_to.add(scorer); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/PhantomKeysManager.java b/src/main/java/org/ldk/structs/PhantomKeysManager.java index 55085267..cb999415 100644 --- a/src/main/java/org/ldk/structs/PhantomKeysManager.java +++ b/src/main/java/org/ldk/structs/PhantomKeysManager.java @@ -66,7 +66,7 @@ public class PhantomKeysManager extends CommonBase { Reference.reachabilityFence(starting_time_nanos); Reference.reachabilityFence(cross_node_seed); if (ret >= 0 && ret <= 4096) { return null; } - PhantomKeysManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PhantomKeysManager(null, ret); } + org.ldk.structs.PhantomKeysManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PhantomKeysManager(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -95,7 +95,7 @@ public class PhantomKeysManager extends CommonBase { Reference.reachabilityFence(channel_value_satoshis); Reference.reachabilityFence(params); if (ret >= 0 && ret <= 4096) { return null; } - InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); } + org.ldk.structs.InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InMemorySigner(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PhantomRouteHints.java b/src/main/java/org/ldk/structs/PhantomRouteHints.java index 459a06fa..b51dbe47 100644 --- a/src/main/java/org/ldk/structs/PhantomRouteHints.java +++ b/src/main/java/org/ldk/structs/PhantomRouteHints.java @@ -32,7 +32,7 @@ public class PhantomRouteHints extends CommonBase { ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret_conv_16_len]; for (int q = 0; q < ret_conv_16_len; q++) { long ret_conv_16 = ret[q]; - ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16); } + org.ldk.structs.ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, ret_conv_16); } ret_conv_16_hu_conv.ptrs_to.add(this); ret_conv_16_arr[q] = ret_conv_16_hu_conv; } @@ -95,7 +95,7 @@ public class PhantomRouteHints extends CommonBase { Reference.reachabilityFence(phantom_scid_arg); Reference.reachabilityFence(real_node_pubkey_arg); if (ret >= 0 && ret <= 4096) { return null; } - PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PhantomRouteHints(null, ret); } + org.ldk.structs.PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PhantomRouteHints(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -113,7 +113,7 @@ public class PhantomRouteHints extends CommonBase { long ret = bindings.PhantomRouteHints_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PhantomRouteHints(null, ret); } + org.ldk.structs.PhantomRouteHints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PhantomRouteHints(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Ping.java b/src/main/java/org/ldk/structs/Ping.java index f7ab7efb..600b20a1 100644 --- a/src/main/java/org/ldk/structs/Ping.java +++ b/src/main/java/org/ldk/structs/Ping.java @@ -66,7 +66,7 @@ public class Ping extends CommonBase { Reference.reachabilityFence(ponglen_arg); Reference.reachabilityFence(byteslen_arg); if (ret >= 0 && ret <= 4096) { return null; } - Ping ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Ping(null, ret); } + org.ldk.structs.Ping ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Ping(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -84,7 +84,7 @@ public class Ping extends CommonBase { long ret = bindings.Ping_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Ping ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Ping(null, ret); } + org.ldk.structs.Ping ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Ping(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Pong.java b/src/main/java/org/ldk/structs/Pong.java index 9e32c65a..6d7991e3 100644 --- a/src/main/java/org/ldk/structs/Pong.java +++ b/src/main/java/org/ldk/structs/Pong.java @@ -47,7 +47,7 @@ public class Pong extends CommonBase { long ret = bindings.Pong_new(byteslen_arg); Reference.reachabilityFence(byteslen_arg); if (ret >= 0 && ret <= 4096) { return null; } - Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Pong(null, ret); } + org.ldk.structs.Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Pong(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -65,7 +65,7 @@ public class Pong extends CommonBase { long ret = bindings.Pong_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Pong(null, ret); } + org.ldk.structs.Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Pong(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PositiveTimestamp.java b/src/main/java/org/ldk/structs/PositiveTimestamp.java index 35e09bd0..dd466b18 100644 --- a/src/main/java/org/ldk/structs/PositiveTimestamp.java +++ b/src/main/java/org/ldk/structs/PositiveTimestamp.java @@ -55,7 +55,7 @@ public class PositiveTimestamp extends CommonBase { long ret = bindings.PositiveTimestamp_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PositiveTimestamp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PositiveTimestamp(null, ret); } + org.ldk.structs.PositiveTimestamp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PositiveTimestamp(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/PrivateRoute.java b/src/main/java/org/ldk/structs/PrivateRoute.java index 060e8b16..c7fed8c5 100644 --- a/src/main/java/org/ldk/structs/PrivateRoute.java +++ b/src/main/java/org/ldk/structs/PrivateRoute.java @@ -36,7 +36,7 @@ public class PrivateRoute extends CommonBase { long ret = bindings.PrivateRoute_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PrivateRoute ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PrivateRoute(null, ret); } + org.ldk.structs.PrivateRoute ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrivateRoute(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -88,7 +88,7 @@ public class PrivateRoute extends CommonBase { long ret = bindings.PrivateRoute_into_inner(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHint(null, ret); } + org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHint(null, ret); } ret_hu_conv.ptrs_to.add(this); ; return ret_hu_conv; diff --git a/src/main/java/org/ldk/structs/ProbabilisticScorer.java b/src/main/java/org/ldk/structs/ProbabilisticScorer.java index 3cb99706..017a1b08 100644 --- a/src/main/java/org/ldk/structs/ProbabilisticScorer.java +++ b/src/main/java/org/ldk/structs/ProbabilisticScorer.java @@ -45,17 +45,30 @@ public class ProbabilisticScorer extends CommonBase { * Creates a new scorer using the given scoring parameters for sending payments from a node * through a network graph. */ - public static ProbabilisticScorer of(ProbabilisticScoringParameters params, NetworkGraph network_graph) { - long ret = bindings.ProbabilisticScorer_new(params == null ? 0 : params.ptr & ~1, network_graph == null ? 0 : network_graph.ptr & ~1); + public static ProbabilisticScorer of(ProbabilisticScoringParameters params, NetworkGraph network_graph, Logger logger) { + long ret = bindings.ProbabilisticScorer_new(params == null ? 0 : params.ptr & ~1, network_graph == null ? 0 : network_graph.ptr & ~1, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(params); Reference.reachabilityFence(network_graph); + Reference.reachabilityFence(logger); if (ret >= 0 && ret <= 4096) { return null; } - ProbabilisticScorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ProbabilisticScorer(null, ret); } + org.ldk.structs.ProbabilisticScorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScorer(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); ret_hu_conv.ptrs_to.add(network_graph); + ret_hu_conv.ptrs_to.add(logger); return ret_hu_conv; } + /** + * Dump the contents of this scorer into the configured logger. + * + * Note that this writes roughly one line per channel for which we have a liquidity estimate, + * which may be a substantial amount of log output. + */ + public void debug_log_liquidity_stats() { + bindings.ProbabilisticScorer_debug_log_liquidity_stats(this.ptr); + Reference.reachabilityFence(this); + } + /** * Constructs a new Score which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is @@ -81,14 +94,16 @@ public class ProbabilisticScorer extends CommonBase { /** * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write */ - public static Result_ProbabilisticScorerDecodeErrorZ read(byte[] ser, ProbabilisticScoringParameters arg_a, NetworkGraph arg_b) { - long ret = bindings.ProbabilisticScorer_read(ser, arg_a == null ? 0 : arg_a.ptr & ~1, arg_b == null ? 0 : arg_b.ptr & ~1); + public static Result_ProbabilisticScorerDecodeErrorZ read(byte[] ser, ProbabilisticScoringParameters arg_a, NetworkGraph arg_b, Logger arg_c) { + long ret = bindings.ProbabilisticScorer_read(ser, arg_a == null ? 0 : arg_a.ptr & ~1, arg_b == null ? 0 : arg_b.ptr & ~1, arg_c == null ? 0 : arg_c.ptr); Reference.reachabilityFence(ser); Reference.reachabilityFence(arg_a); Reference.reachabilityFence(arg_b); + Reference.reachabilityFence(arg_c); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(arg_b); + ret_hu_conv.ptrs_to.add(arg_c); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ProbabilisticScoringParameters.java b/src/main/java/org/ldk/structs/ProbabilisticScoringParameters.java index 4aa7a119..96e66ac9 100644 --- a/src/main/java/org/ldk/structs/ProbabilisticScoringParameters.java +++ b/src/main/java/org/ldk/structs/ProbabilisticScoringParameters.java @@ -189,7 +189,7 @@ public class ProbabilisticScoringParameters extends CommonBase { Reference.reachabilityFence(liquidity_offset_half_life_arg); Reference.reachabilityFence(amount_penalty_multiplier_msat_arg); if (ret >= 0 && ret <= 4096) { return null; } - ProbabilisticScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ProbabilisticScoringParameters(null, ret); } + org.ldk.structs.ProbabilisticScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringParameters(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -207,7 +207,7 @@ public class ProbabilisticScoringParameters extends CommonBase { long ret = bindings.ProbabilisticScoringParameters_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ProbabilisticScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ProbabilisticScoringParameters(null, ret); } + org.ldk.structs.ProbabilisticScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -218,7 +218,7 @@ public class ProbabilisticScoringParameters extends CommonBase { public static ProbabilisticScoringParameters with_default() { long ret = bindings.ProbabilisticScoringParameters_default(); if (ret >= 0 && ret <= 4096) { return null; } - ProbabilisticScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ProbabilisticScoringParameters(null, ret); } + org.ldk.structs.ProbabilisticScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringParameters(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/QueryChannelRange.java b/src/main/java/org/ldk/structs/QueryChannelRange.java index fb7b8060..2e82c151 100644 --- a/src/main/java/org/ldk/structs/QueryChannelRange.java +++ b/src/main/java/org/ldk/structs/QueryChannelRange.java @@ -86,7 +86,7 @@ public class QueryChannelRange extends CommonBase { Reference.reachabilityFence(first_blocknum_arg); Reference.reachabilityFence(number_of_blocks_arg); if (ret >= 0 && ret <= 4096) { return null; } - QueryChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryChannelRange(null, ret); } + org.ldk.structs.QueryChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryChannelRange(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -104,7 +104,7 @@ public class QueryChannelRange extends CommonBase { long ret = bindings.QueryChannelRange_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - QueryChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryChannelRange(null, ret); } + org.ldk.structs.QueryChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryChannelRange(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/QueryShortChannelIds.java b/src/main/java/org/ldk/structs/QueryShortChannelIds.java index aeb49aae..6be3a63d 100644 --- a/src/main/java/org/ldk/structs/QueryShortChannelIds.java +++ b/src/main/java/org/ldk/structs/QueryShortChannelIds.java @@ -62,7 +62,7 @@ public class QueryShortChannelIds extends CommonBase { Reference.reachabilityFence(chain_hash_arg); Reference.reachabilityFence(short_channel_ids_arg); if (ret >= 0 && ret <= 4096) { return null; } - QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryShortChannelIds(null, ret); } + org.ldk.structs.QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -80,7 +80,7 @@ public class QueryShortChannelIds extends CommonBase { long ret = bindings.QueryShortChannelIds_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryShortChannelIds(null, ret); } + org.ldk.structs.QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RapidGossipSync.java b/src/main/java/org/ldk/structs/RapidGossipSync.java new file mode 100644 index 00000000..e95b3511 --- /dev/null +++ b/src/main/java/org/ldk/structs/RapidGossipSync.java @@ -0,0 +1,82 @@ +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; + + +/** + * Rapid Gossip Sync struct + * See [crate-level documentation] for usage. + * + * [crate-level documentation]: crate + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class RapidGossipSync extends CommonBase { + RapidGossipSync(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.RapidGossipSync_free(ptr); } + } + + /** + * Instantiate a new [`RapidGossipSync`] instance + */ + public static RapidGossipSync of(NetworkGraph network_graph) { + long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr & ~1); + Reference.reachabilityFence(network_graph); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RapidGossipSync ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RapidGossipSync(null, ret); } + ret_hu_conv.ptrs_to.add(ret_hu_conv); + ret_hu_conv.ptrs_to.add(network_graph); + return ret_hu_conv; + } + + /** + * Sync gossip data from a file + * Returns the last sync timestamp to be used the next time rapid sync data is queried. + * + * `network_graph`: The network graph to apply the updates to + * + * `sync_path`: Path to the file where the gossip update data is located + */ + public Result_u32GraphSyncErrorZ sync_network_graph_with_file_path(java.lang.String sync_path) { + long ret = bindings.RapidGossipSync_sync_network_graph_with_file_path(this.ptr, sync_path); + Reference.reachabilityFence(this); + Reference.reachabilityFence(sync_path); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Returns whether a rapid gossip sync has completed at least once + */ + public boolean is_initial_sync_complete() { + boolean ret = bindings.RapidGossipSync_is_initial_sync_complete(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Update network graph from binary data. + * Returns the last sync timestamp to be used the next time rapid sync data is queried. + * + * `network_graph`: network graph to be updated + * + * `update_data`: `&[u8]` binary stream that comprises the update data + */ + public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) { + long ret = bindings.RapidGossipSync_update_network_graph(this.ptr, update_data); + Reference.reachabilityFence(this); + Reference.reachabilityFence(update_data); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/RawDataPart.java b/src/main/java/org/ldk/structs/RawDataPart.java index e79d9a61..97af0520 100644 --- a/src/main/java/org/ldk/structs/RawDataPart.java +++ b/src/main/java/org/ldk/structs/RawDataPart.java @@ -27,7 +27,7 @@ public class RawDataPart extends CommonBase { long ret = bindings.RawDataPart_get_timestamp(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PositiveTimestamp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PositiveTimestamp(null, ret); } + org.ldk.structs.PositiveTimestamp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PositiveTimestamp(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -71,7 +71,7 @@ public class RawDataPart extends CommonBase { long ret = bindings.RawDataPart_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawDataPart(null, ret); } + org.ldk.structs.RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawDataPart(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RawInvoice.java b/src/main/java/org/ldk/structs/RawInvoice.java index 3bdb47c1..1e17348d 100644 --- a/src/main/java/org/ldk/structs/RawInvoice.java +++ b/src/main/java/org/ldk/structs/RawInvoice.java @@ -31,7 +31,7 @@ public class RawInvoice extends CommonBase { long ret = bindings.RawInvoice_get_data(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawDataPart(null, ret); } + org.ldk.structs.RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawDataPart(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -75,7 +75,7 @@ public class RawInvoice extends CommonBase { long ret = bindings.RawInvoice_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); } + org.ldk.structs.RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawInvoice(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -97,7 +97,7 @@ public class RawInvoice extends CommonBase { long ret = bindings.RawInvoice_payment_hash(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); } + org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -110,7 +110,7 @@ public class RawInvoice extends CommonBase { long ret = bindings.RawInvoice_description(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Description(null, ret); } + org.ldk.structs.Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Description(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -123,7 +123,7 @@ public class RawInvoice extends CommonBase { long ret = bindings.RawInvoice_payee_pub_key(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); } + org.ldk.structs.PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PayeePubKey(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -136,7 +136,7 @@ public class RawInvoice extends CommonBase { long ret = bindings.RawInvoice_description_hash(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); } + org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -149,7 +149,7 @@ public class RawInvoice extends CommonBase { long ret = bindings.RawInvoice_expiry_time(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ExpiryTime(null, ret); } + org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -162,7 +162,7 @@ public class RawInvoice extends CommonBase { long ret = bindings.RawInvoice_min_final_cltv_expiry(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MinFinalCltvExpiry(null, ret); } + org.ldk.structs.MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MinFinalCltvExpiry(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -185,7 +185,7 @@ public class RawInvoice extends CommonBase { long ret = bindings.RawInvoice_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); } + org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -197,7 +197,7 @@ public class RawInvoice extends CommonBase { PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret_conv_14_len]; for (int o = 0; o < ret_conv_14_len; o++) { long ret_conv_14 = ret[o]; - PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14); } + org.ldk.structs.PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new org.ldk.structs.PrivateRoute(null, ret_conv_14); } ret_conv_14_hu_conv.ptrs_to.add(this); ret_conv_14_arr[o] = ret_conv_14_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java index 80bc7bb9..1d82f25b 100644 --- a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java +++ b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java @@ -12,11 +12,9 @@ import javax.annotation.Nullable; * A read-only view of [`NetworkGraph`]. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class ReadOnlyNetworkGraph extends CommonBase { +public class ReadOnlyNetworkGraph extends CommonBase implements AutoCloseable { ReadOnlyNetworkGraph(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); + @Override public void close() { if (ptr != 0) { bindings.ReadOnlyNetworkGraph_free(ptr); } } diff --git a/src/main/java/org/ldk/structs/Record.java b/src/main/java/org/ldk/structs/Record.java index fc75ebd2..a172a272 100644 --- a/src/main/java/org/ldk/structs/Record.java +++ b/src/main/java/org/ldk/structs/Record.java @@ -124,7 +124,7 @@ public class Record extends CommonBase { long ret = bindings.Record_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Record ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Record(null, ret); } + org.ldk.structs.Record ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Record(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ReplyChannelRange.java b/src/main/java/org/ldk/structs/ReplyChannelRange.java index 59f11a75..ce08c8a8 100644 --- a/src/main/java/org/ldk/structs/ReplyChannelRange.java +++ b/src/main/java/org/ldk/structs/ReplyChannelRange.java @@ -118,7 +118,7 @@ public class ReplyChannelRange extends CommonBase { Reference.reachabilityFence(sync_complete_arg); Reference.reachabilityFence(short_channel_ids_arg); if (ret >= 0 && ret <= 4096) { return null; } - ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); } + org.ldk.structs.ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyChannelRange(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -136,7 +136,7 @@ public class ReplyChannelRange extends CommonBase { long ret = bindings.ReplyChannelRange_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); } + org.ldk.structs.ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyChannelRange(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java index eaeef3f4..ce8385fc 100644 --- a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java +++ b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java @@ -69,7 +69,7 @@ public class ReplyShortChannelIdsEnd extends CommonBase { Reference.reachabilityFence(chain_hash_arg); Reference.reachabilityFence(full_information_arg); if (ret >= 0 && ret <= 4096) { return null; } - ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); } + org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -87,7 +87,7 @@ public class ReplyShortChannelIdsEnd extends CommonBase { long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); } + org.ldk.structs.ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java index c286a63f..000ad169 100644 --- a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { private Result_AcceptChannelDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_AcceptChannelDecodeErrorZ_get_ok(ptr); - AcceptChannel res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new AcceptChannel(null, res); } + org.ldk.structs.AcceptChannel res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.AcceptChannel(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { private Result_AcceptChannelDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_AcceptChannelDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java index 9b25747a..d9f6c5b0 100644 --- a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { private Result_AnnouncementSignaturesDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(ptr); - AnnouncementSignatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new AnnouncementSignatures(null, res); } + org.ldk.structs.AnnouncementSignatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { private Result_AnnouncementSignaturesDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java index 458a88ee..293abc56 100644 --- a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { private Result_BuiltCommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(ptr); - BuiltCommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new BuiltCommitmentTransaction(null, res); } + org.ldk.structs.BuiltCommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BuiltCommitmentTransaction(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { private Result_BuiltCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java index 8dcd59f1..2a49c364 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java index 6e899322..830034e1 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java index badb260d..c91f8de3 100644 --- a/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase { private Result_COption_ClosureReasonZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java index 50c5a69f..01ca9680 100644 --- a/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_COption_EventZDecodeErrorZ extends CommonBase { private Result_COption_EventZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_COption_EventZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java index dc2c2b8b..4a416397 100644 --- a/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase { private Result_COption_MonitorEventZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_COption_MonitorEventZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java index 61dee22c..ff8be1cc 100644 --- a/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase { private Result_COption_NetworkUpdateZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java index 0e65ec7b..e1cd7923 100644 --- a/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_COption_TypeZDecodeErrorZ extends CommonBase { private Result_COption_TypeZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_COption_TypeZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java index 59124cda..3df51c62 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java @@ -33,7 +33,7 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { private Result_CVec_u8ZPeerHandleErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_CVec_u8ZPeerHandleErrorZ_get_err(ptr); - PeerHandleError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new PeerHandleError(null, err); } + org.ldk.structs.PeerHandleError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.PeerHandleError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java index 902fd544..680b989a 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { private Result_ChannelAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelAnnouncementDecodeErrorZ_get_ok(ptr); - ChannelAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelAnnouncement(null, res); } + org.ldk.structs.ChannelAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { private Result_ChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelAnnouncementDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java index 8f0bd202..793cae81 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { private Result_ChannelConfigDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelConfigDecodeErrorZ_get_ok(ptr); - ChannelConfig res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelConfig(null, res); } + org.ldk.structs.ChannelConfig res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelConfig(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { private Result_ChannelConfigDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelConfigDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java index 64951141..f14fc045 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelCounterpartyDecodeErrorZ extends CommonBase { private Result_ChannelCounterpartyDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelCounterpartyDecodeErrorZ_get_ok(ptr); - ChannelCounterparty res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelCounterparty(null, res); } + org.ldk.structs.ChannelCounterparty res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelCounterparty(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelCounterpartyDecodeErrorZ extends CommonBase { private Result_ChannelCounterpartyDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelCounterpartyDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java index a69d38ce..55ea2dea 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelDetailsDecodeErrorZ extends CommonBase { private Result_ChannelDetailsDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelDetailsDecodeErrorZ_get_ok(ptr); - ChannelDetails res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelDetails(null, res); } + org.ldk.structs.ChannelDetails res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelDetails(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelDetailsDecodeErrorZ extends CommonBase { private Result_ChannelDetailsDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelDetailsDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java index d5f341a3..6c5676eb 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { private Result_ChannelFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelFeaturesDecodeErrorZ_get_ok(ptr); - ChannelFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelFeatures(null, res); } + org.ldk.structs.ChannelFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelFeatures(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { private Result_ChannelFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelFeaturesDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } @@ -73,4 +73,22 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java index 41fc5ca3..9c792e8a 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { private Result_ChannelInfoDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelInfoDecodeErrorZ_get_ok(ptr); - ChannelInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelInfo(null, res); } + org.ldk.structs.ChannelInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelInfo(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { private Result_ChannelInfoDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelInfoDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java index 5842593e..61934c45 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { private Result_ChannelMonitorUpdateDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(ptr); - ChannelMonitorUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelMonitorUpdate(null, res); } + org.ldk.structs.ChannelMonitorUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { private Result_ChannelMonitorUpdateDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java index 7e063154..988386c0 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { private Result_ChannelPublicKeysDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelPublicKeysDecodeErrorZ_get_ok(ptr); - ChannelPublicKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelPublicKeys(null, res); } + org.ldk.structs.ChannelPublicKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { private Result_ChannelPublicKeysDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelPublicKeysDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java new file mode 100644 index 00000000..49a5e8f4 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.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; + +public class Result_ChannelReadyDecodeErrorZ extends CommonBase { + private Result_ChannelReadyDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_ChannelReadyDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_ChannelReadyDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ChannelReadyDecodeErrorZ_is_ok(ptr)) { + return new Result_ChannelReadyDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ChannelReadyDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_ChannelReadyDecodeErrorZ_OK extends Result_ChannelReadyDecodeErrorZ { + public final ChannelReady res; + private Result_ChannelReadyDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_ChannelReadyDecodeErrorZ_get_ok(ptr); + org.ldk.structs.ChannelReady res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelReady(null, res); } + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_ChannelReadyDecodeErrorZ_Err extends Result_ChannelReadyDecodeErrorZ { + public final DecodeError err; + private Result_ChannelReadyDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_ChannelReadyDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state. + */ + public static Result_ChannelReadyDecodeErrorZ ok(ChannelReady o) { + long ret = bindings.CResult_ChannelReadyDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state. + */ + public static Result_ChannelReadyDecodeErrorZ err(DecodeError e) { + long ret = bindings.CResult_ChannelReadyDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.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_ChannelReadyDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_ChannelReadyDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelReadyDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelReadyDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java index ea07093c..853ff9e0 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { private Result_ChannelReestablishDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelReestablishDecodeErrorZ_get_ok(ptr); - ChannelReestablish res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelReestablish(null, res); } + org.ldk.structs.ChannelReestablish res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelReestablish(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { private Result_ChannelReestablishDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelReestablishDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java index dec7486b..37209e5b 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase private Result_ChannelTransactionParametersDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(ptr); - ChannelTransactionParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelTransactionParameters(null, res); } + org.ldk.structs.ChannelTransactionParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase private Result_ChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java index 597d4e1b..80062246 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase { private Result_ChannelTypeFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(ptr); - ChannelTypeFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelTypeFeatures(null, res); } + org.ldk.structs.ChannelTypeFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase { private Result_ChannelTypeFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } @@ -73,4 +73,22 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelTypeFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java index 1299ed39..fed9815a 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { private Result_ChannelUpdateDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelUpdateDecodeErrorZ_get_ok(ptr); - ChannelUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelUpdate(null, res); } + org.ldk.structs.ChannelUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelUpdate(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { private Result_ChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelUpdateDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java index 7386d0ad..5c4ae076 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ChannelUpdateInfoDecodeErrorZ extends CommonBase { private Result_ChannelUpdateInfoDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(ptr); - ChannelUpdateInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelUpdateInfo(null, res); } + org.ldk.structs.ChannelUpdateInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ChannelUpdateInfoDecodeErrorZ extends CommonBase { private Result_ChannelUpdateInfoDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ChannelUpdateInfoDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java index 98a5fd1f..27612438 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { private Result_ClosingSignedDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ClosingSignedDecodeErrorZ_get_ok(ptr); - ClosingSigned res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ClosingSigned(null, res); } + org.ldk.structs.ClosingSigned res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ClosingSigned(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { private Result_ClosingSignedDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ClosingSignedDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java index f54e4123..87c2e69d 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { private Result_ClosingSignedFeeRangeDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(ptr); - ClosingSignedFeeRange res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ClosingSignedFeeRange(null, res); } + org.ldk.structs.ClosingSignedFeeRange res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ClosingSignedFeeRange(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { private Result_ClosingSignedFeeRangeDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java index 49a806a4..96e3806d 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { private Result_CommitmentSignedDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_CommitmentSignedDecodeErrorZ_get_ok(ptr); - CommitmentSigned res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new CommitmentSigned(null, res); } + org.ldk.structs.CommitmentSigned res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.CommitmentSigned(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { private Result_CommitmentSignedDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_CommitmentSignedDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java index 88b282e8..5d8edc0c 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { private Result_CommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_CommitmentTransactionDecodeErrorZ_get_ok(ptr); - CommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new CommitmentTransaction(null, res); } + org.ldk.structs.CommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.CommitmentTransaction(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { private Result_CommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_CommitmentTransactionDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java index 0d95419f..d78318e5 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends private Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(ptr); - CounterpartyChannelTransactionParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new CounterpartyChannelTransactionParameters(null, res); } + org.ldk.structs.CounterpartyChannelTransactionParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.CounterpartyChannelTransactionParameters(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends private Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java index 0f0f11e0..097afb2e 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ extends CommonBase private Result_CounterpartyCommitmentSecretsDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(ptr); - CounterpartyCommitmentSecrets res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new CounterpartyCommitmentSecrets(null, res); } + org.ldk.structs.CounterpartyCommitmentSecrets res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.CounterpartyCommitmentSecrets(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ extends CommonBase private Result_CounterpartyCommitmentSecretsDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java index 1b322384..ba4a1c2e 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ extends CommonBase { private Result_CounterpartyForwardingInfoDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(ptr); - CounterpartyForwardingInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new CounterpartyForwardingInfo(null, res); } + org.ldk.structs.CounterpartyForwardingInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.CounterpartyForwardingInfo(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ extends CommonBase { private Result_CounterpartyForwardingInfoDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java index f7e75983..f49ceb40 100644 --- a/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas private Result_DelayedPaymentOutputDescriptorDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(ptr); - DelayedPaymentOutputDescriptor res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new DelayedPaymentOutputDescriptor(null, res); } + org.ldk.structs.DelayedPaymentOutputDescriptor res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.DelayedPaymentOutputDescriptor(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas private Result_DelayedPaymentOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java index 4a8ac5ee..38f92e1a 100644 --- a/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java @@ -25,7 +25,7 @@ public class Result_DescriptionCreationErrorZ extends CommonBase { private Result_DescriptionCreationErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_DescriptionCreationErrorZ_get_ok(ptr); - Description res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Description(null, res); } + org.ldk.structs.Description res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Description(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java index 3536aef7..2e4924ff 100644 --- a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { private Result_ErrorMessageDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ErrorMessageDecodeErrorZ_get_ok(ptr); - ErrorMessage res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ErrorMessage(null, res); } + org.ldk.structs.ErrorMessage res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ErrorMessage(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { private Result_ErrorMessageDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ErrorMessageDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java index f93a0bed..5dc1717b 100644 --- a/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_FixedPenaltyScorerDecodeErrorZ extends CommonBase { private Result_FixedPenaltyScorerDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(ptr); - FixedPenaltyScorer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new FixedPenaltyScorer(null, res); } + org.ldk.structs.FixedPenaltyScorer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.FixedPenaltyScorer(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_FixedPenaltyScorerDecodeErrorZ extends CommonBase { private Result_FixedPenaltyScorerDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_FixedPenaltyScorerDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java index 9f456ac9..03368d83 100644 --- a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { private Result_FundingCreatedDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_FundingCreatedDecodeErrorZ_get_ok(ptr); - FundingCreated res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new FundingCreated(null, res); } + org.ldk.structs.FundingCreated res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.FundingCreated(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { private Result_FundingCreatedDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_FundingCreatedDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java deleted file mode 100644 index a3cc558c..00000000 --- a/src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java +++ /dev/null @@ -1,94 +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_FundingLockedDecodeErrorZ extends CommonBase { - private Result_FundingLockedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_FundingLockedDecodeErrorZ_free(ptr); } super.finalize(); - } - - static Result_FundingLockedDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_FundingLockedDecodeErrorZ_is_ok(ptr)) { - return new Result_FundingLockedDecodeErrorZ_OK(null, ptr); - } else { - return new Result_FundingLockedDecodeErrorZ_Err(null, ptr); - } - } - public static final class Result_FundingLockedDecodeErrorZ_OK extends Result_FundingLockedDecodeErrorZ { - public final FundingLocked res; - private Result_FundingLockedDecodeErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_FundingLockedDecodeErrorZ_get_ok(ptr); - FundingLocked res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new FundingLocked(null, res); } - res_hu_conv.ptrs_to.add(this); - this.res = res_hu_conv; - } - } - - public static final class Result_FundingLockedDecodeErrorZ_Err extends Result_FundingLockedDecodeErrorZ { - public final DecodeError err; - private Result_FundingLockedDecodeErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_FundingLockedDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } - err_hu_conv.ptrs_to.add(this); - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_FundingLockedDecodeErrorZ in the success state. - */ - public static Result_FundingLockedDecodeErrorZ ok(FundingLocked o) { - long ret = bindings.CResult_FundingLockedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_FundingLockedDecodeErrorZ in the error state. - */ - public static Result_FundingLockedDecodeErrorZ err(DecodeError e) { - long ret = bindings.CResult_FundingLockedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.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_FundingLockedDecodeErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_FundingLockedDecodeErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_FundingLockedDecodeErrorZ clone() { - long ret = bindings.CResult_FundingLockedDecodeErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java index 973e2229..0a26133d 100644 --- a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { private Result_FundingSignedDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_FundingSignedDecodeErrorZ_get_ok(ptr); - FundingSigned res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new FundingSigned(null, res); } + org.ldk.structs.FundingSigned res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.FundingSigned(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { private Result_FundingSignedDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_FundingSignedDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java index 58413f32..0dace109 100644 --- a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { private Result_GossipTimestampFilterDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_GossipTimestampFilterDecodeErrorZ_get_ok(ptr); - GossipTimestampFilter res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new GossipTimestampFilter(null, res); } + org.ldk.structs.GossipTimestampFilter res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.GossipTimestampFilter(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { private Result_GossipTimestampFilterDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_GossipTimestampFilterDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java index 142917d1..c343108c 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { private Result_HTLCOutputInCommitmentDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(ptr); - HTLCOutputInCommitment res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new HTLCOutputInCommitment(null, res); } + org.ldk.structs.HTLCOutputInCommitment res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { private Result_HTLCOutputInCommitmentDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java index 245c3014..85478272 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { private Result_HTLCUpdateDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_HTLCUpdateDecodeErrorZ_get_ok(ptr); - HTLCUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new HTLCUpdate(null, res); } + org.ldk.structs.HTLCUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.HTLCUpdate(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { private Result_HTLCUpdateDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_HTLCUpdateDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java index a9bea3c2..1cc91f3b 100644 --- a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { private Result_HolderCommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(ptr); - HolderCommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new HolderCommitmentTransaction(null, res); } + org.ldk.structs.HolderCommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { private Result_HolderCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java index d73488a9..0156f568 100644 --- a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { private Result_InMemorySignerDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_InMemorySignerDecodeErrorZ_get_ok(ptr); - InMemorySigner res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new InMemorySigner(null, res); } + org.ldk.structs.InMemorySigner res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InMemorySigner(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { private Result_InMemorySignerDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_InMemorySignerDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java index fff9d31b..76b3041d 100644 --- a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_InitDecodeErrorZ extends CommonBase { private Result_InitDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_InitDecodeErrorZ_get_ok(ptr); - Init res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Init(null, res); } + org.ldk.structs.Init res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Init(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_InitDecodeErrorZ extends CommonBase { private Result_InitDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_InitDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java index 18ba7001..f7b66612 100644 --- a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { private Result_InitFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_InitFeaturesDecodeErrorZ_get_ok(ptr); - InitFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new InitFeatures(null, res); } + org.ldk.structs.InitFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InitFeatures(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { private Result_InitFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_InitFeaturesDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } @@ -73,4 +73,22 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.CResult_InitFeaturesDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InitFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_InitFeaturesDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java index 73c46071..44f796d2 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { private Result_InvoiceFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_InvoiceFeaturesDecodeErrorZ_get_ok(ptr); - InvoiceFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new InvoiceFeatures(null, res); } + org.ldk.structs.InvoiceFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceFeatures(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { private Result_InvoiceFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_InvoiceFeaturesDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } @@ -73,4 +73,22 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InvoiceFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.java index 597e1cfc..4a480fa0 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.java @@ -25,7 +25,7 @@ public class Result_InvoiceParseOrSemanticErrorZ extends CommonBase { private Result_InvoiceParseOrSemanticErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_InvoiceParseOrSemanticErrorZ_get_ok(ptr); - Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Invoice(null, res); } + org.ldk.structs.Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Invoice(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java index f7d74093..08db30eb 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java @@ -25,7 +25,7 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase { private Result_InvoiceSemanticErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_InvoiceSemanticErrorZ_get_ok(ptr); - Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Invoice(null, res); } + org.ldk.structs.Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Invoice(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java index 3d91088d..21fc7173 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java @@ -25,7 +25,7 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase { private Result_InvoiceSignOrCreationErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_InvoiceSignOrCreationErrorZ_get_ok(ptr); - Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Invoice(null, res); } + org.ldk.structs.Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Invoice(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java b/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java index a82c5e19..22029054 100644 --- a/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java @@ -25,7 +25,7 @@ public class Result_LockedChannelMonitorNoneZ extends CommonBase { private Result_LockedChannelMonitorNoneZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_LockedChannelMonitorNoneZ_get_ok(ptr); - LockedChannelMonitor res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new LockedChannelMonitor(null, res); } + org.ldk.structs.LockedChannelMonitor res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.LockedChannelMonitor(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java index eb44c631..fe40d28e 100644 --- a/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase { private Result_NetAddressDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_NetAddressDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java index 983c14d6..74f23337 100644 --- a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { private Result_NetworkGraphDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_NetworkGraphDecodeErrorZ_get_ok(ptr); - NetworkGraph res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NetworkGraph(null, res); } + org.ldk.structs.NetworkGraph res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.NetworkGraph(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { private Result_NetworkGraphDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_NetworkGraphDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } @@ -45,11 +45,14 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state. */ - public static Result_NetworkGraphDecodeErrorZ ok(NetworkGraph o) { - long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); - Reference.reachabilityFence(o); + public static Result_NetworkGraphDecodeErrorZ ok(byte[] o_genesis_hash, Logger o_logger) { + long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(bindings.NetworkGraph_new(InternalUtils.check_arr_len(o_genesis_hash, 32), o_logger == null ? 0 : o_logger.ptr)); + Reference.reachabilityFence(o_genesis_hash); + Reference.reachabilityFence(o_logger); if (ret >= 0 && ret <= 4096) { return null; } Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); + ; + ret_hu_conv.ptrs_to.add(o_logger); return ret_hu_conv; } @@ -73,22 +76,4 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { return ret; } - long clone_ptr() { - long ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_NetworkGraphDecodeErrorZ clone() { - long ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - } diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java index 536b1614..442038df 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { private Result_NodeAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_NodeAnnouncementDecodeErrorZ_get_ok(ptr); - NodeAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeAnnouncement(null, res); } + org.ldk.structs.NodeAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.NodeAnnouncement(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { private Result_NodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_NodeAnnouncementDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java index 9ca3e4b2..86f41dce 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { private Result_NodeAnnouncementInfoDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(ptr); - NodeAnnouncementInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeAnnouncementInfo(null, res); } + org.ldk.structs.NodeAnnouncementInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.NodeAnnouncementInfo(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { private Result_NodeAnnouncementInfoDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java index f457a380..a80ebf1f 100644 --- a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { private Result_NodeFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_NodeFeaturesDecodeErrorZ_get_ok(ptr); - NodeFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeFeatures(null, res); } + org.ldk.structs.NodeFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.NodeFeatures(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { private Result_NodeFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_NodeFeaturesDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } @@ -73,4 +73,22 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NodeFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java index 8336795e..5ea59851 100644 --- a/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { private Result_NodeIdDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_NodeIdDecodeErrorZ_get_ok(ptr); - NodeId res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeId(null, res); } + org.ldk.structs.NodeId res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.NodeId(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { private Result_NodeIdDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_NodeIdDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java index 706b966a..4adf55af 100644 --- a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { private Result_NodeInfoDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_NodeInfoDecodeErrorZ_get_ok(ptr); - NodeInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeInfo(null, res); } + org.ldk.structs.NodeInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.NodeInfo(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { private Result_NodeInfoDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_NodeInfoDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java index 8e7b07ca..ce9ee1a5 100644 --- a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java @@ -31,7 +31,7 @@ public class Result_NoneLightningErrorZ extends CommonBase { private Result_NoneLightningErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_NoneLightningErrorZ_get_err(ptr); - LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new LightningError(null, err); } + org.ldk.structs.LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.LightningError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java index 4f817e68..6928890b 100644 --- a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java @@ -31,7 +31,7 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { private Result_NonePeerHandleErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_NonePeerHandleErrorZ_get_err(ptr); - PeerHandleError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new PeerHandleError(null, err); } + org.ldk.structs.PeerHandleError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.PeerHandleError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java index 35f1bfcb..32e2d2d1 100644 --- a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { private Result_OpenChannelDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_OpenChannelDecodeErrorZ_get_ok(ptr); - OpenChannel res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new OpenChannel(null, res); } + org.ldk.structs.OpenChannel res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OpenChannel(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { private Result_OpenChannelDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_OpenChannelDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java index fcf6ba99..59cd0d89 100644 --- a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { private Result_OutPointDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_OutPointDecodeErrorZ_get_ok(ptr); - OutPoint res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new OutPoint(null, res); } + org.ldk.structs.OutPoint res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OutPoint(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { private Result_OutPointDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_OutPointDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java index bc44a763..07635ec5 100644 --- a/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java @@ -25,7 +25,7 @@ public class Result_PayeePubKeyErrorZ extends CommonBase { private Result_PayeePubKeyErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_PayeePubKeyErrorZ_get_ok(ptr); - PayeePubKey res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new PayeePubKey(null, res); } + org.ldk.structs.PayeePubKey res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.PayeePubKey(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java index bfaf0b65..400c860e 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_PaymentParametersDecodeErrorZ extends CommonBase { private Result_PaymentParametersDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_PaymentParametersDecodeErrorZ_get_ok(ptr); - PaymentParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new PaymentParameters(null, res); } + org.ldk.structs.PaymentParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.PaymentParameters(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_PaymentParametersDecodeErrorZ extends CommonBase { private Result_PaymentParametersDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_PaymentParametersDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java new file mode 100644 index 00000000..09aca060 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.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; + +public class Result_PaymentPurposeDecodeErrorZ extends CommonBase { + private Result_PaymentPurposeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_PaymentPurposeDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_PaymentPurposeDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_PaymentPurposeDecodeErrorZ_is_ok(ptr)) { + return new Result_PaymentPurposeDecodeErrorZ_OK(null, ptr); + } else { + return new Result_PaymentPurposeDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_PaymentPurposeDecodeErrorZ_OK extends Result_PaymentPurposeDecodeErrorZ { + public final PaymentPurpose res; + private Result_PaymentPurposeDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_PaymentPurposeDecodeErrorZ_get_ok(ptr); + org.ldk.structs.PaymentPurpose res_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(res); + res_hu_conv.ptrs_to.add(this); + this.res = res_hu_conv; + } + } + + public static final class Result_PaymentPurposeDecodeErrorZ_Err extends Result_PaymentPurposeDecodeErrorZ { + public final DecodeError err; + private Result_PaymentPurposeDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_PaymentPurposeDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state. + */ + public static Result_PaymentPurposeDecodeErrorZ ok(PaymentPurpose o) { + long ret = bindings.CResult_PaymentPurposeDecodeErrorZ_ok(o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state. + */ + public static Result_PaymentPurposeDecodeErrorZ err(DecodeError e) { + long ret = bindings.CResult_PaymentPurposeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.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_PaymentPurposeDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PaymentPurposeDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PaymentPurposeDecodeErrorZ clone() { + long ret = bindings.CResult_PaymentPurposeDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java index 8caea0eb..ed620de4 100644 --- a/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_PhantomRouteHintsDecodeErrorZ extends CommonBase { private Result_PhantomRouteHintsDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_PhantomRouteHintsDecodeErrorZ_get_ok(ptr); - PhantomRouteHints res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new PhantomRouteHints(null, res); } + org.ldk.structs.PhantomRouteHints res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.PhantomRouteHints(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_PhantomRouteHintsDecodeErrorZ extends CommonBase { private Result_PhantomRouteHintsDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_PhantomRouteHintsDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java index e2ca63f1..9312080b 100644 --- a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_PingDecodeErrorZ extends CommonBase { private Result_PingDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_PingDecodeErrorZ_get_ok(ptr); - Ping res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Ping(null, res); } + org.ldk.structs.Ping res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Ping(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_PingDecodeErrorZ extends CommonBase { private Result_PingDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_PingDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java index ed8c0164..f0dac0e4 100644 --- a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_PongDecodeErrorZ extends CommonBase { private Result_PongDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_PongDecodeErrorZ_get_ok(ptr); - Pong res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Pong(null, res); } + org.ldk.structs.Pong res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Pong(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_PongDecodeErrorZ extends CommonBase { private Result_PongDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_PongDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java index be43ee6f..5396b061 100644 --- a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java @@ -25,7 +25,7 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { private Result_PositiveTimestampCreationErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_PositiveTimestampCreationErrorZ_get_ok(ptr); - PositiveTimestamp res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new PositiveTimestamp(null, res); } + org.ldk.structs.PositiveTimestamp res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.PositiveTimestamp(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java index abd98632..3ba88f11 100644 --- a/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java @@ -25,7 +25,7 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase { private Result_PrivateRouteCreationErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_PrivateRouteCreationErrorZ_get_ok(ptr); - PrivateRoute res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new PrivateRoute(null, res); } + org.ldk.structs.PrivateRoute res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.PrivateRoute(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java index ed67c854..c2b3782a 100644 --- a/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ProbabilisticScorerDecodeErrorZ extends CommonBase { private Result_ProbabilisticScorerDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ProbabilisticScorerDecodeErrorZ_get_ok(ptr); - ProbabilisticScorer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ProbabilisticScorer(null, res); } + org.ldk.structs.ProbabilisticScorer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ProbabilisticScorer(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ProbabilisticScorerDecodeErrorZ extends CommonBase { private Result_ProbabilisticScorerDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ProbabilisticScorerDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } @@ -45,14 +45,16 @@ public class Result_ProbabilisticScorerDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state. */ - public static Result_ProbabilisticScorerDecodeErrorZ ok(ProbabilisticScoringParameters o_params, NetworkGraph o_network_graph) { - long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_params == null ? 0 : o_params.ptr & ~1, o_network_graph == null ? 0 : o_network_graph.ptr & ~1)); + public static Result_ProbabilisticScorerDecodeErrorZ ok(ProbabilisticScoringParameters o_params, NetworkGraph o_network_graph, Logger o_logger) { + long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_params == null ? 0 : o_params.ptr & ~1, o_network_graph == null ? 0 : o_network_graph.ptr & ~1, o_logger == null ? 0 : o_logger.ptr)); Reference.reachabilityFence(o_params); Reference.reachabilityFence(o_network_graph); + Reference.reachabilityFence(o_logger); if (ret >= 0 && ret <= 4096) { return null; } Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret); ; ret_hu_conv.ptrs_to.add(o_network_graph); + ret_hu_conv.ptrs_to.add(o_logger); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java index 4660b34a..994d3f60 100644 --- a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { private Result_QueryChannelRangeDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_QueryChannelRangeDecodeErrorZ_get_ok(ptr); - QueryChannelRange res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new QueryChannelRange(null, res); } + org.ldk.structs.QueryChannelRange res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.QueryChannelRange(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { private Result_QueryChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_QueryChannelRangeDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java index cfd4cfc7..911cbf13 100644 --- a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { private Result_QueryShortChannelIdsDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(ptr); - QueryShortChannelIds res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new QueryShortChannelIds(null, res); } + org.ldk.structs.QueryShortChannelIds res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { private Result_QueryShortChannelIdsDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java index 28974ed6..e3882e37 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { private Result_ReplyChannelRangeDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ReplyChannelRangeDecodeErrorZ_get_ok(ptr); - ReplyChannelRange res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ReplyChannelRange(null, res); } + org.ldk.structs.ReplyChannelRange res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ReplyChannelRange(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { private Result_ReplyChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ReplyChannelRangeDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java index d9a67cc3..2c9ddcc0 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { private Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(ptr); - ReplyShortChannelIdsEnd res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ReplyShortChannelIdsEnd(null, res); } + org.ldk.structs.ReplyShortChannelIdsEnd res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { private Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java index 7851c831..82323518 100644 --- a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { private Result_RevokeAndACKDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_RevokeAndACKDecodeErrorZ_get_ok(ptr); - RevokeAndACK res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RevokeAndACK(null, res); } + org.ldk.structs.RevokeAndACK res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.RevokeAndACK(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { private Result_RevokeAndACKDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_RevokeAndACKDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java index e6f0fdb2..95ecb477 100644 --- a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_RouteDecodeErrorZ extends CommonBase { private Result_RouteDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_RouteDecodeErrorZ_get_ok(ptr); - Route res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Route(null, res); } + org.ldk.structs.Route res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Route(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_RouteDecodeErrorZ extends CommonBase { private Result_RouteDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_RouteDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java index 0d00d7fe..e0a3a83e 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { private Result_RouteHintDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_RouteHintDecodeErrorZ_get_ok(ptr); - RouteHint res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RouteHint(null, res); } + org.ldk.structs.RouteHint res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.RouteHint(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { private Result_RouteHintDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_RouteHintDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java index 042d0be2..e2041cf6 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { private Result_RouteHintHopDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_RouteHintHopDecodeErrorZ_get_ok(ptr); - RouteHintHop res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RouteHintHop(null, res); } + org.ldk.structs.RouteHintHop res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.RouteHintHop(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { private Result_RouteHintHopDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_RouteHintHopDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java index ff6b998f..fc926456 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { private Result_RouteHopDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_RouteHopDecodeErrorZ_get_ok(ptr); - RouteHop res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RouteHop(null, res); } + org.ldk.structs.RouteHop res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.RouteHop(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { private Result_RouteHopDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_RouteHopDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java index 1a0a282a..3bf65cf9 100644 --- a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java @@ -25,7 +25,7 @@ public class Result_RouteLightningErrorZ extends CommonBase { private Result_RouteLightningErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_RouteLightningErrorZ_get_ok(ptr); - Route res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Route(null, res); } + org.ldk.structs.Route res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Route(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_RouteLightningErrorZ extends CommonBase { private Result_RouteLightningErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_RouteLightningErrorZ_get_err(ptr); - LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new LightningError(null, err); } + org.ldk.structs.LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.LightningError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java index b3d9e6dc..edc33f4a 100644 --- a/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { private Result_RouteParametersDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_RouteParametersDecodeErrorZ_get_ok(ptr); - RouteParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RouteParameters(null, res); } + org.ldk.structs.RouteParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.RouteParameters(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { private Result_RouteParametersDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_RouteParametersDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java index bd47b922..361a2cf9 100644 --- a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { private Result_RoutingFeesDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_RoutingFeesDecodeErrorZ_get_ok(ptr); - RoutingFees res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RoutingFees(null, res); } + org.ldk.structs.RoutingFees res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.RoutingFees(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { private Result_RoutingFeesDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_RoutingFeesDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ScorerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ScorerDecodeErrorZ.java deleted file mode 100644 index 5909f4c2..00000000 --- a/src/main/java/org/ldk/structs/Result_ScorerDecodeErrorZ.java +++ /dev/null @@ -1,77 +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_ScorerDecodeErrorZ extends CommonBase { - private Result_ScorerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_ScorerDecodeErrorZ_free(ptr); } super.finalize(); - } - - static Result_ScorerDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_ScorerDecodeErrorZ_is_ok(ptr)) { - return new Result_ScorerDecodeErrorZ_OK(null, ptr); - } else { - return new Result_ScorerDecodeErrorZ_Err(null, ptr); - } - } - public static final class Result_ScorerDecodeErrorZ_OK extends Result_ScorerDecodeErrorZ { - public final Scorer res; - private Result_ScorerDecodeErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_ScorerDecodeErrorZ_get_ok(ptr); - Scorer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Scorer(null, res); } - res_hu_conv.ptrs_to.add(this); - this.res = res_hu_conv; - } - } - - public static final class Result_ScorerDecodeErrorZ_Err extends Result_ScorerDecodeErrorZ { - public final DecodeError err; - private Result_ScorerDecodeErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_ScorerDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } - err_hu_conv.ptrs_to.add(this); - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_ScorerDecodeErrorZ in the success state. - */ - public static Result_ScorerDecodeErrorZ ok(ScoringParameters o_params) { - long ret = bindings.CResult_ScorerDecodeErrorZ_ok(bindings.Scorer_new(o_params == null ? 0 : o_params.ptr & ~1)); - Reference.reachabilityFence(o_params); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret); - ; - return ret_hu_conv; - } - - /** - * Creates a new CResult_ScorerDecodeErrorZ in the error state. - */ - public static Result_ScorerDecodeErrorZ err(DecodeError e) { - long ret = bindings.CResult_ScorerDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.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_ScorerDecodeErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_ScoringParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ScoringParametersDecodeErrorZ.java deleted file mode 100644 index 2b4d58dd..00000000 --- a/src/main/java/org/ldk/structs/Result_ScoringParametersDecodeErrorZ.java +++ /dev/null @@ -1,94 +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_ScoringParametersDecodeErrorZ extends CommonBase { - private Result_ScoringParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_ScoringParametersDecodeErrorZ_free(ptr); } super.finalize(); - } - - static Result_ScoringParametersDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_ScoringParametersDecodeErrorZ_is_ok(ptr)) { - return new Result_ScoringParametersDecodeErrorZ_OK(null, ptr); - } else { - return new Result_ScoringParametersDecodeErrorZ_Err(null, ptr); - } - } - public static final class Result_ScoringParametersDecodeErrorZ_OK extends Result_ScoringParametersDecodeErrorZ { - public final ScoringParameters res; - private Result_ScoringParametersDecodeErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_ScoringParametersDecodeErrorZ_get_ok(ptr); - ScoringParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ScoringParameters(null, res); } - res_hu_conv.ptrs_to.add(this); - this.res = res_hu_conv; - } - } - - public static final class Result_ScoringParametersDecodeErrorZ_Err extends Result_ScoringParametersDecodeErrorZ { - public final DecodeError err; - private Result_ScoringParametersDecodeErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_ScoringParametersDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } - err_hu_conv.ptrs_to.add(this); - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_ScoringParametersDecodeErrorZ in the success state. - */ - public static Result_ScoringParametersDecodeErrorZ ok(ScoringParameters o) { - long ret = bindings.CResult_ScoringParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_ScoringParametersDecodeErrorZ in the error state. - */ - public static Result_ScoringParametersDecodeErrorZ err(DecodeError e) { - long ret = bindings.CResult_ScoringParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.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_ScoringParametersDecodeErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_ScoringParametersDecodeErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_ScoringParametersDecodeErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_ScoringParametersDecodeErrorZ clone() { - long ret = bindings.CResult_ScoringParametersDecodeErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java index 70f2c365..3668b3c9 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { private Result_ShutdownDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ShutdownDecodeErrorZ_get_ok(ptr); - Shutdown res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Shutdown(null, res); } + org.ldk.structs.Shutdown res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Shutdown(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { private Result_ShutdownDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ShutdownDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java index 34795801..02f4759a 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { private Result_ShutdownScriptDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ShutdownScriptDecodeErrorZ_get_ok(ptr); - ShutdownScript res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ShutdownScript(null, res); } + org.ldk.structs.ShutdownScript res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ShutdownScript(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { private Result_ShutdownScriptDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ShutdownScriptDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java b/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java index 36250715..324d467e 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java @@ -25,7 +25,7 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { private Result_ShutdownScriptInvalidShutdownScriptZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(ptr); - ShutdownScript res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ShutdownScript(null, res); } + org.ldk.structs.ShutdownScript res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ShutdownScript(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { private Result_ShutdownScriptInvalidShutdownScriptZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(ptr); - InvalidShutdownScript err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new InvalidShutdownScript(null, err); } + org.ldk.structs.InvalidShutdownScript err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.InvalidShutdownScript(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java index 52fd5a59..4f083c3c 100644 --- a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_SignDecodeErrorZ extends CommonBase { private Result_SignDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_SignDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.java b/src/main/java/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.java index 6d21088f..1c7c969b 100644 --- a/src/main/java/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.java @@ -25,7 +25,7 @@ public class Result_SignedRawInvoiceParseErrorZ extends CommonBase { private Result_SignedRawInvoiceParseErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_SignedRawInvoiceParseErrorZ_get_ok(ptr); - SignedRawInvoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new SignedRawInvoice(null, res); } + org.ldk.structs.SignedRawInvoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.SignedRawInvoice(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java index c3ecc783..a723ae20 100644 --- a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java @@ -36,7 +36,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { private Result_SpendableOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java index b1be9793..f476777c 100644 --- a/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase private Result_StaticPaymentOutputDescriptorDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(ptr); - StaticPaymentOutputDescriptor res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new StaticPaymentOutputDescriptor(null, res); } + org.ldk.structs.StaticPaymentOutputDescriptor res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.StaticPaymentOutputDescriptor(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase private Result_StaticPaymentOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_StringErrorZ.java b/src/main/java/org/ldk/structs/Result_StringErrorZ.java index ab9fe384..16fe5237 100644 --- a/src/main/java/org/ldk/structs/Result_StringErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_StringErrorZ.java @@ -67,4 +67,22 @@ public class Result_StringErrorZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.CResult_StringErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_StringErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_StringErrorZ clone() { + long ret = bindings.CResult_StringErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java index fc6b0659..a7a71bba 100644 --- a/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java @@ -25,7 +25,7 @@ public class Result_TrustedClosingTransactionNoneZ extends CommonBase { private Result_TrustedClosingTransactionNoneZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_TrustedClosingTransactionNoneZ_get_ok(ptr); - TrustedClosingTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new TrustedClosingTransaction(null, res); } + org.ldk.structs.TrustedClosingTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TrustedClosingTransaction(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java index 2c0f94f5..f080bc63 100644 --- a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java @@ -25,7 +25,7 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { private Result_TrustedCommitmentTransactionNoneZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_TrustedCommitmentTransactionNoneZ_get_ok(ptr); - TrustedCommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new TrustedCommitmentTransaction(null, res); } + org.ldk.structs.TrustedCommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TrustedCommitmentTransaction(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java index e3663158..6c2e8d9e 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { private Result_TxCreationKeysDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_TxCreationKeysDecodeErrorZ_get_ok(ptr); - TxCreationKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new TxCreationKeys(null, res); } + org.ldk.structs.TxCreationKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxCreationKeys(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { private Result_TxCreationKeysDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_TxCreationKeysDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java index b2c6b8c7..6e6e34d3 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java @@ -25,7 +25,7 @@ public class Result_TxCreationKeysErrorZ extends CommonBase { private Result_TxCreationKeysErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_TxCreationKeysErrorZ_get_ok(ptr); - TxCreationKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new TxCreationKeys(null, res); } + org.ldk.structs.TxCreationKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxCreationKeys(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java index 021d9c82..ec05a118 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { private Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(ptr); - UnsignedChannelAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UnsignedChannelAnnouncement(null, res); } + org.ldk.structs.UnsignedChannelAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { private Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java index 53af7ab3..52b82ef9 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { private Result_UnsignedChannelUpdateDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(ptr); - UnsignedChannelUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UnsignedChannelUpdate(null, res); } + org.ldk.structs.UnsignedChannelUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { private Result_UnsignedChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java index 26ac2c42..e589e617 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { private Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(ptr); - UnsignedNodeAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UnsignedNodeAnnouncement(null, res); } + org.ldk.structs.UnsignedNodeAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UnsignedNodeAnnouncement(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { private Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java index 27412852..3d6f65b9 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { private Result_UpdateAddHTLCDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_UpdateAddHTLCDecodeErrorZ_get_ok(ptr); - UpdateAddHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateAddHTLC(null, res); } + org.ldk.structs.UpdateAddHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UpdateAddHTLC(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { private Result_UpdateAddHTLCDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_UpdateAddHTLCDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java index b22cc5cd..13b4824b 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFailHTLCDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_UpdateFailHTLCDecodeErrorZ_get_ok(ptr); - UpdateFailHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateFailHTLC(null, res); } + org.ldk.structs.UpdateFailHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UpdateFailHTLC(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFailHTLCDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_UpdateFailHTLCDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java index 8e1f8a5f..d089ef13 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(ptr); - UpdateFailMalformedHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateFailMalformedHTLC(null, res); } + org.ldk.structs.UpdateFailMalformedHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UpdateFailMalformedHTLC(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java index 682e11a2..b71f97da 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { private Result_UpdateFeeDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_UpdateFeeDecodeErrorZ_get_ok(ptr); - UpdateFee res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateFee(null, res); } + org.ldk.structs.UpdateFee res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UpdateFee(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { private Result_UpdateFeeDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_UpdateFeeDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java index 3956c137..b7451895 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFulfillHTLCDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(ptr); - UpdateFulfillHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateFulfillHTLC(null, res); } + org.ldk.structs.UpdateFulfillHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UpdateFulfillHTLC(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { private Result_UpdateFulfillHTLCDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java index 01e68cca..b91d8212 100644 --- a/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java @@ -25,7 +25,7 @@ public class Result_WarningMessageDecodeErrorZ extends CommonBase { private Result_WarningMessageDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); long res = bindings.CResult_WarningMessageDecodeErrorZ_get_ok(ptr); - WarningMessage res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new WarningMessage(null, res); } + org.ldk.structs.WarningMessage res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.WarningMessage(null, res); } res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; } @@ -36,7 +36,7 @@ public class Result_WarningMessageDecodeErrorZ extends CommonBase { private Result_WarningMessageDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_WarningMessageDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); } + org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java index 1e036433..d9ff5200 100644 --- a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java @@ -33,7 +33,7 @@ public class Result_boolLightningErrorZ extends CommonBase { private Result_boolLightningErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_boolLightningErrorZ_get_err(ptr); - LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new LightningError(null, err); } + org.ldk.structs.LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.LightningError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java index b0dd75bd..96e9a143 100644 --- a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java @@ -33,7 +33,7 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { private Result_boolPeerHandleErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); long err = bindings.CResult_boolPeerHandleErrorZ_get_err(ptr); - PeerHandleError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new PeerHandleError(null, err); } + org.ldk.structs.PeerHandleError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.PeerHandleError(null, err); } err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java b/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java new file mode 100644 index 00000000..0c9c0337 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.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; + +public class Result_u32GraphSyncErrorZ extends CommonBase { + private Result_u32GraphSyncErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_u32GraphSyncErrorZ_free(ptr); } super.finalize(); + } + + static Result_u32GraphSyncErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_u32GraphSyncErrorZ_is_ok(ptr)) { + return new Result_u32GraphSyncErrorZ_OK(null, ptr); + } else { + return new Result_u32GraphSyncErrorZ_Err(null, ptr); + } + } + public static final class Result_u32GraphSyncErrorZ_OK extends Result_u32GraphSyncErrorZ { + public final int res; + private Result_u32GraphSyncErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + this.res = bindings.CResult_u32GraphSyncErrorZ_get_ok(ptr); + } + } + + public static final class Result_u32GraphSyncErrorZ_Err extends Result_u32GraphSyncErrorZ { + public final GraphSyncError err; + private Result_u32GraphSyncErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_u32GraphSyncErrorZ_get_err(ptr); + org.ldk.structs.GraphSyncError err_hu_conv = org.ldk.structs.GraphSyncError.constr_from_ptr(err); + err_hu_conv.ptrs_to.add(this); + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_u32GraphSyncErrorZ in the success state. + */ + public static Result_u32GraphSyncErrorZ ok(int o) { + long ret = bindings.CResult_u32GraphSyncErrorZ_ok(o); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_u32GraphSyncErrorZ in the error state. + */ + public static Result_u32GraphSyncErrorZ err(GraphSyncError e) { + long ret = bindings.CResult_u32GraphSyncErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.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_u32GraphSyncErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + +} diff --git a/src/main/java/org/ldk/structs/Retry.java b/src/main/java/org/ldk/structs/Retry.java new file mode 100644 index 00000000..2f2b4d8f --- /dev/null +++ b/src/main/java/org/ldk/structs/Retry.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; + + +/** + * Strategies available to retry payment path failures for an [`Invoice`]. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Retry extends CommonBase { + private Retry(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.Retry_free(ptr); } + } + static Retry constr_from_ptr(long ptr) { + bindings.LDKRetry raw_val = bindings.LDKRetry_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKRetry.Attempts.class) { + return new Attempts(ptr, (bindings.LDKRetry.Attempts)raw_val); + } + if (raw_val.getClass() == bindings.LDKRetry.Timeout.class) { + return new Timeout(ptr, (bindings.LDKRetry.Timeout)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * Max number of attempts to retry payment. + * + * Note that this is the number of *path* failures, not full payment retries. For multi-path + * payments, if this is less than the total number of paths, we will never even retry all of the + * payment's paths. + */ + public final static class Attempts extends Retry { + public final long attempts; + private Attempts(long ptr, bindings.LDKRetry.Attempts obj) { + super(null, ptr); + this.attempts = obj.attempts; + } + } + /** + * Time elapsed before abandoning retries for a payment. + */ + public final static class Timeout extends Retry { + public final long timeout; + private Timeout(long ptr, bindings.LDKRetry.Timeout obj) { + super(null, ptr); + this.timeout = obj.timeout; + } + } + long clone_ptr() { + long ret = bindings.Retry_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the Retry + */ + public Retry clone() { + long ret = bindings.Retry_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Retry ret_hu_conv = org.ldk.structs.Retry.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Attempts-variant Retry + */ + public static Retry attempts(long a) { + long ret = bindings.Retry_attempts(a); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Retry ret_hu_conv = org.ldk.structs.Retry.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Timeout-variant Retry + */ + public static Retry timeout(long a) { + long ret = bindings.Retry_timeout(a); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Retry ret_hu_conv = org.ldk.structs.Retry.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + /** + * Checks if two Retrys contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public boolean eq(Retry b) { + boolean ret = bindings.Retry_eq(this.ptr, b == null ? 0 : b.ptr & ~1); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof Retry)) return false; + return this.eq((Retry)o); + } + /** + * Checks if two Retrys contain equal inner contents. + */ + public long hash() { + long ret = bindings.Retry_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } +} diff --git a/src/main/java/org/ldk/structs/RetryAttempts.java b/src/main/java/org/ldk/structs/RetryAttempts.java deleted file mode 100644 index 84f832ee..00000000 --- a/src/main/java/org/ldk/structs/RetryAttempts.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; - - -/** - * Number of attempts to retry payment path failures for an [`Invoice`]. - * - * Note that this is the number of *path* failures, not full payment retries. For multi-path - * payments, if this is less than the total number of paths, we will never even retry all of the - * payment's paths. - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class RetryAttempts extends CommonBase { - RetryAttempts(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.RetryAttempts_free(ptr); } - } - - public long get_a() { - long ret = bindings.RetryAttempts_get_a(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - public void set_a(long val) { - bindings.RetryAttempts_set_a(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * Constructs a new RetryAttempts given each field - */ - public static RetryAttempts of(long a_arg) { - long ret = bindings.RetryAttempts_new(a_arg); - Reference.reachabilityFence(a_arg); - if (ret >= 0 && ret <= 4096) { return null; } - RetryAttempts ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RetryAttempts(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.RetryAttempts_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a copy of the RetryAttempts - */ - public RetryAttempts clone() { - long ret = bindings.RetryAttempts_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - RetryAttempts ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RetryAttempts(null, ret); } - ret_hu_conv.ptrs_to.add(this); - return ret_hu_conv; - } - - /** - * Checks if two RetryAttemptss 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(RetryAttempts b) { - boolean ret = bindings.RetryAttempts_eq(this.ptr, b == null ? 0 : b.ptr & ~1); - Reference.reachabilityFence(this); - Reference.reachabilityFence(b); - this.ptrs_to.add(b); - return ret; - } - - @Override public boolean equals(Object o) { - if (!(o instanceof RetryAttempts)) return false; - return this.eq((RetryAttempts)o); - } - /** - * Checks if two RetryAttemptss contain equal inner contents. - */ - public long hash() { - long ret = bindings.RetryAttempts_hash(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - @Override public int hashCode() { - return (int)this.hash(); - } -} diff --git a/src/main/java/org/ldk/structs/RevokeAndACK.java b/src/main/java/org/ldk/structs/RevokeAndACK.java index 8284f9e3..b7f6064e 100644 --- a/src/main/java/org/ldk/structs/RevokeAndACK.java +++ b/src/main/java/org/ldk/structs/RevokeAndACK.java @@ -83,7 +83,7 @@ public class RevokeAndACK extends CommonBase { Reference.reachabilityFence(per_commitment_secret_arg); Reference.reachabilityFence(next_per_commitment_point_arg); if (ret >= 0 && ret <= 4096) { return null; } - RevokeAndACK ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RevokeAndACK(null, ret); } + org.ldk.structs.RevokeAndACK ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RevokeAndACK(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -101,7 +101,7 @@ public class RevokeAndACK extends CommonBase { long ret = bindings.RevokeAndACK_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RevokeAndACK ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RevokeAndACK(null, ret); } + org.ldk.structs.RevokeAndACK ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RevokeAndACK(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Route.java b/src/main/java/org/ldk/structs/Route.java index 74a08d98..9c95aca9 100644 --- a/src/main/java/org/ldk/structs/Route.java +++ b/src/main/java/org/ldk/structs/Route.java @@ -23,11 +23,10 @@ public class Route extends CommonBase { /** * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the - * last RouteHop in each path must be the same. - * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the - * destination. Thus, this must always be at least length one. While the maximum length of any - * given path is variable, keeping the length of any path to less than 20 should currently - * ensure it is viable. + * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT + * INCLUDING our own, where the last hop is the destination. Thus, this must always be at + * least length one. While the maximum length of any given path is variable, keeping the length + * of any path less or equal to 19 should currently ensure it is viable. */ public RouteHop[][] get_paths() { long[][] ret = bindings.Route_get_paths(this.ptr); @@ -40,7 +39,7 @@ public class Route extends CommonBase { RouteHop[] ret_conv_12_conv_10_arr = new RouteHop[ret_conv_12_conv_10_len]; for (int k = 0; k < ret_conv_12_conv_10_len; k++) { long ret_conv_12_conv_10 = ret_conv_12[k]; - RouteHop ret_conv_12_conv_10_hu_conv = null; if (ret_conv_12_conv_10 < 0 || ret_conv_12_conv_10 > 4096) { ret_conv_12_conv_10_hu_conv = new RouteHop(null, ret_conv_12_conv_10); } + org.ldk.structs.RouteHop ret_conv_12_conv_10_hu_conv = null; if (ret_conv_12_conv_10 < 0 || ret_conv_12_conv_10 > 4096) { ret_conv_12_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, ret_conv_12_conv_10); } ret_conv_12_conv_10_hu_conv.ptrs_to.add(this); ret_conv_12_conv_10_arr[k] = ret_conv_12_conv_10_hu_conv; } @@ -51,11 +50,10 @@ public class Route extends CommonBase { /** * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the - * last RouteHop in each path must be the same. - * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the - * destination. Thus, this must always be at least length one. While the maximum length of any - * given path is variable, keeping the length of any path to less than 20 should currently - * ensure it is viable. + * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT + * INCLUDING our own, where the last hop is the destination. Thus, this must always be at + * least length one. While the maximum length of any given path is variable, keeping the length + * of any path less or equal to 19 should currently ensure it is viable. */ public void set_paths(RouteHop[][] val) { bindings.Route_set_paths(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> val_conv_12 != null ? Arrays.stream(val_conv_12).mapToLong(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray() : null).toArray(long[][]::new) : null); @@ -77,7 +75,7 @@ public class Route extends CommonBase { long ret = bindings.Route_get_payment_params(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PaymentParameters(null, ret); } + org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -105,7 +103,7 @@ public class Route extends CommonBase { Reference.reachabilityFence(paths_arg); Reference.reachabilityFence(payment_params_arg); if (ret >= 0 && ret <= 4096) { return null; } - Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Route(null, ret); } + org.ldk.structs.Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Route(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -123,7 +121,7 @@ public class Route extends CommonBase { long ret = bindings.Route_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Route(null, ret); } + org.ldk.structs.Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Route(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RouteHint.java b/src/main/java/org/ldk/structs/RouteHint.java index 9fb65a0d..d5a994b4 100644 --- a/src/main/java/org/ldk/structs/RouteHint.java +++ b/src/main/java/org/ldk/structs/RouteHint.java @@ -27,7 +27,7 @@ public class RouteHint extends CommonBase { RouteHintHop[] ret_conv_14_arr = new RouteHintHop[ret_conv_14_len]; for (int o = 0; o < ret_conv_14_len; o++) { long ret_conv_14 = ret[o]; - RouteHintHop ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new RouteHintHop(null, ret_conv_14); } + org.ldk.structs.RouteHintHop ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new org.ldk.structs.RouteHintHop(null, ret_conv_14); } ret_conv_14_hu_conv.ptrs_to.add(this); ret_conv_14_arr[o] = ret_conv_14_hu_conv; } @@ -47,7 +47,7 @@ public class RouteHint extends CommonBase { long ret = bindings.RouteHint_new(a_arg != null ? Arrays.stream(a_arg).mapToLong(a_arg_conv_14 -> a_arg_conv_14 == null ? 0 : a_arg_conv_14.ptr & ~1).toArray() : null); Reference.reachabilityFence(a_arg); if (ret >= 0 && ret <= 4096) { return null; } - RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHint(null, ret); } + org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHint(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -65,7 +65,7 @@ public class RouteHint extends CommonBase { long ret = bindings.RouteHint_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHint(null, ret); } + org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RouteHintHop.java b/src/main/java/org/ldk/structs/RouteHintHop.java index e59be65b..119937c9 100644 --- a/src/main/java/org/ldk/structs/RouteHintHop.java +++ b/src/main/java/org/ldk/structs/RouteHintHop.java @@ -63,7 +63,7 @@ public class RouteHintHop extends CommonBase { long ret = bindings.RouteHintHop_get_fees(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); } + org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -149,7 +149,7 @@ public class RouteHintHop extends CommonBase { Reference.reachabilityFence(htlc_minimum_msat_arg); Reference.reachabilityFence(htlc_maximum_msat_arg); if (ret >= 0 && ret <= 4096) { return null; } - RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHintHop(null, ret); } + org.ldk.structs.RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHintHop(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -167,7 +167,7 @@ public class RouteHintHop extends CommonBase { long ret = bindings.RouteHintHop_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHintHop(null, ret); } + org.ldk.structs.RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHintHop(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RouteHop.java b/src/main/java/org/ldk/structs/RouteHop.java index c7c3c80b..0052ed3e 100644 --- a/src/main/java/org/ldk/structs/RouteHop.java +++ b/src/main/java/org/ldk/structs/RouteHop.java @@ -46,7 +46,7 @@ public class RouteHop extends CommonBase { long ret = bindings.RouteHop_get_node_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -87,7 +87,7 @@ public class RouteHop extends CommonBase { long ret = bindings.RouteHop_get_channel_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); } + org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -156,7 +156,7 @@ public class RouteHop extends CommonBase { Reference.reachabilityFence(fee_msat_arg); Reference.reachabilityFence(cltv_expiry_delta_arg); if (ret >= 0 && ret <= 4096) { return null; } - RouteHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHop(null, ret); } + org.ldk.structs.RouteHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHop(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -174,7 +174,7 @@ public class RouteHop extends CommonBase { long ret = bindings.RouteHop_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RouteHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHop(null, ret); } + org.ldk.structs.RouteHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHop(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RouteParameters.java b/src/main/java/org/ldk/structs/RouteParameters.java index 45afee42..3bcd8652 100644 --- a/src/main/java/org/ldk/structs/RouteParameters.java +++ b/src/main/java/org/ldk/structs/RouteParameters.java @@ -11,8 +11,8 @@ import javax.annotation.Nullable; /** * Parameters needed to find a [`Route`]. * - * Passed to [`find_route`] and also provided in [`Event::PaymentPathFailed`] for retrying a failed - * payment path. + * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in + * [`Event::PaymentPathFailed`] for retrying a failed payment path. * * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed */ @@ -32,7 +32,7 @@ public class RouteParameters extends CommonBase { long ret = bindings.RouteParameters_get_payment_params(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PaymentParameters(null, ret); } + org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -91,7 +91,7 @@ public class RouteParameters extends CommonBase { Reference.reachabilityFence(final_value_msat_arg); Reference.reachabilityFence(final_cltv_expiry_delta_arg); if (ret >= 0 && ret <= 4096) { return null; } - RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteParameters(null, ret); } + org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -109,7 +109,7 @@ public class RouteParameters extends CommonBase { long ret = bindings.RouteParameters_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteParameters(null, ret); } + org.ldk.structs.RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteParameters(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Router.java b/src/main/java/org/ldk/structs/Router.java index 43f1aa14..eaa9b9ef 100644 --- a/src/main/java/org/ldk/structs/Router.java +++ b/src/main/java/org/ldk/structs/Router.java @@ -37,12 +37,12 @@ public class Router extends CommonBase { final LDKRouterHolder impl_holder = new LDKRouterHolder(); impl_holder.held = new Router(new bindings.LDKRouter() { @Override public long find_route(byte[] payer, long route_params, byte[] payment_hash, long[] first_hops, long scorer) { - RouteParameters route_params_hu_conv = null; if (route_params < 0 || route_params > 4096) { route_params_hu_conv = new RouteParameters(null, route_params); } + org.ldk.structs.RouteParameters route_params_hu_conv = null; if (route_params < 0 || route_params > 4096) { route_params_hu_conv = new org.ldk.structs.RouteParameters(null, route_params); } int first_hops_conv_16_len = first_hops.length; ChannelDetails[] first_hops_conv_16_arr = new ChannelDetails[first_hops_conv_16_len]; for (int q = 0; q < first_hops_conv_16_len; q++) { long first_hops_conv_16 = first_hops[q]; - ChannelDetails first_hops_conv_16_hu_conv = null; if (first_hops_conv_16 < 0 || first_hops_conv_16 > 4096) { first_hops_conv_16_hu_conv = new ChannelDetails(null, first_hops_conv_16); } + org.ldk.structs.ChannelDetails first_hops_conv_16_hu_conv = null; if (first_hops_conv_16 < 0 || first_hops_conv_16 > 4096) { first_hops_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, first_hops_conv_16); } first_hops_conv_16_hu_conv.ptrs_to.add(this); first_hops_conv_16_arr[q] = first_hops_conv_16_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RoutingFees.java b/src/main/java/org/ldk/structs/RoutingFees.java index d1c885ff..2055ec2a 100644 --- a/src/main/java/org/ldk/structs/RoutingFees.java +++ b/src/main/java/org/ldk/structs/RoutingFees.java @@ -66,7 +66,7 @@ public class RoutingFees extends CommonBase { Reference.reachabilityFence(base_msat_arg); Reference.reachabilityFence(proportional_millionths_arg); if (ret >= 0 && ret <= 4096) { return null; } - RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); } + org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -101,7 +101,7 @@ public class RoutingFees extends CommonBase { long ret = bindings.RoutingFees_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); } + org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RoutingMessageHandler.java b/src/main/java/org/ldk/structs/RoutingMessageHandler.java index bd31e4e3..f884de24 100644 --- a/src/main/java/org/ldk/structs/RoutingMessageHandler.java +++ b/src/main/java/org/ldk/structs/RoutingMessageHandler.java @@ -97,21 +97,21 @@ public class RoutingMessageHandler extends CommonBase { final LDKRoutingMessageHandlerHolder impl_holder = new LDKRoutingMessageHandlerHolder(); impl_holder.held = new RoutingMessageHandler(new bindings.LDKRoutingMessageHandler() { @Override public long handle_node_announcement(long msg) { - NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new NodeAnnouncement(null, 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); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long handle_channel_announcement(long msg) { - ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelAnnouncement(null, 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); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } @Override public long handle_channel_update(long msg) { - ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, 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); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); @@ -130,12 +130,12 @@ public class RoutingMessageHandler extends CommonBase { return result; } @Override public void peer_connected(byte[] their_node_id, long init) { - Init init_hu_conv = null; if (init < 0 || init > 4096) { init_hu_conv = new Init(null, init); } + org.ldk.structs.Init init_hu_conv = null; if (init < 0 || init > 4096) { init_hu_conv = new org.ldk.structs.Init(null, init); } arg.peer_connected(their_node_id, init_hu_conv); Reference.reachabilityFence(arg); } @Override public long handle_reply_channel_range(byte[] their_node_id, long msg) { - ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyChannelRange(null, msg); } + org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); } msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_reply_channel_range(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); @@ -143,7 +143,7 @@ public class RoutingMessageHandler extends CommonBase { return result; } @Override public long handle_reply_short_channel_ids_end(byte[] their_node_id, long msg) { - ReplyShortChannelIdsEnd msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyShortChannelIdsEnd(null, msg); } + org.ldk.structs.ReplyShortChannelIdsEnd msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyShortChannelIdsEnd(null, msg); } msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_reply_short_channel_ids_end(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); @@ -151,7 +151,7 @@ public class RoutingMessageHandler extends CommonBase { return result; } @Override public long handle_query_channel_range(byte[] their_node_id, long msg) { - QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryChannelRange(null, msg); } + org.ldk.structs.QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryChannelRange(null, msg); } msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_query_channel_range(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); @@ -159,7 +159,7 @@ public class RoutingMessageHandler extends CommonBase { return result; } @Override public long handle_query_short_channel_ids(byte[] their_node_id, long msg) { - QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryShortChannelIds(null, msg); } + org.ldk.structs.QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.QueryShortChannelIds(null, msg); } msg_hu_conv.ptrs_to.add(this); Result_NoneLightningErrorZ ret = arg.handle_query_short_channel_ids(their_node_id, msg_hu_conv); Reference.reachabilityFence(arg); @@ -259,7 +259,7 @@ public class RoutingMessageHandler extends CommonBase { NodeAnnouncement[] ret_conv_18_arr = new NodeAnnouncement[ret_conv_18_len]; for (int s = 0; s < ret_conv_18_len; s++) { long ret_conv_18 = ret[s]; - NodeAnnouncement ret_conv_18_hu_conv = null; if (ret_conv_18 < 0 || ret_conv_18 > 4096) { ret_conv_18_hu_conv = new NodeAnnouncement(null, ret_conv_18); } + org.ldk.structs.NodeAnnouncement ret_conv_18_hu_conv = null; if (ret_conv_18 < 0 || ret_conv_18 > 4096) { ret_conv_18_hu_conv = new org.ldk.structs.NodeAnnouncement(null, ret_conv_18); } ret_conv_18_hu_conv.ptrs_to.add(this); ret_conv_18_arr[s] = ret_conv_18_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Score.java b/src/main/java/org/ldk/structs/Score.java index a1d8498d..9758decc 100644 --- a/src/main/java/org/ldk/structs/Score.java +++ b/src/main/java/org/ldk/structs/Score.java @@ -37,7 +37,7 @@ public class Score extends CommonBase { * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount. * Thus, implementations should be overflow-safe. */ - long channel_penalty_msat(long short_channel_id, long send_amt_msat, long capacity_msat, NodeId source, NodeId target); + long channel_penalty_msat(long short_channel_id, NodeId source, NodeId target, ChannelUsage usage); /** * Handles updating channel penalties after failing to route through a channel. */ @@ -55,10 +55,12 @@ public class Score extends CommonBase { public static Score new_impl(ScoreInterface arg) { final LDKScoreHolder impl_holder = new LDKScoreHolder(); impl_holder.held = new Score(new bindings.LDKScore() { - @Override public long channel_penalty_msat(long short_channel_id, long send_amt_msat, long capacity_msat, long source, long target) { - NodeId source_hu_conv = null; if (source < 0 || source > 4096) { source_hu_conv = new NodeId(null, source); } - NodeId target_hu_conv = null; if (target < 0 || target > 4096) { target_hu_conv = new NodeId(null, target); } - long ret = arg.channel_penalty_msat(short_channel_id, send_amt_msat, capacity_msat, source_hu_conv, target_hu_conv); + @Override public long channel_penalty_msat(long short_channel_id, long source, long target, long usage) { + org.ldk.structs.NodeId source_hu_conv = null; if (source < 0 || source > 4096) { source_hu_conv = new org.ldk.structs.NodeId(null, source); } + org.ldk.structs.NodeId target_hu_conv = null; if (target < 0 || target > 4096) { target_hu_conv = new org.ldk.structs.NodeId(null, target); } + org.ldk.structs.ChannelUsage usage_hu_conv = null; if (usage < 0 || usage > 4096) { usage_hu_conv = new org.ldk.structs.ChannelUsage(null, usage); } + usage_hu_conv.ptrs_to.add(this); + long ret = arg.channel_penalty_msat(short_channel_id, source_hu_conv, target_hu_conv, usage_hu_conv); Reference.reachabilityFence(arg); return ret; } @@ -67,7 +69,7 @@ public class Score extends CommonBase { RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len]; for (int k = 0; k < path_conv_10_len; k++) { long path_conv_10 = path[k]; - RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new RouteHop(null, path_conv_10); } + org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); } path_conv_10_hu_conv.ptrs_to.add(this); path_conv_10_arr[k] = path_conv_10_hu_conv; } @@ -79,7 +81,7 @@ public class Score extends CommonBase { RouteHop[] path_conv_10_arr = new RouteHop[path_conv_10_len]; for (int k = 0; k < path_conv_10_len; k++) { long path_conv_10 = path[k]; - RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new RouteHop(null, path_conv_10); } + org.ldk.structs.RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new org.ldk.structs.RouteHop(null, path_conv_10); } path_conv_10_hu_conv.ptrs_to.add(this); path_conv_10_arr[k] = path_conv_10_hu_conv; } @@ -104,14 +106,13 @@ public class Score extends CommonBase { * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount. * Thus, implementations should be overflow-safe. */ - public long channel_penalty_msat(long short_channel_id, long send_amt_msat, long capacity_msat, NodeId source, NodeId target) { - long ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, send_amt_msat, capacity_msat, source == null ? 0 : source.ptr & ~1, target == null ? 0 : target.ptr & ~1); + public long channel_penalty_msat(long short_channel_id, NodeId source, NodeId target, ChannelUsage usage) { + long ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, source == null ? 0 : source.ptr & ~1, target == null ? 0 : target.ptr & ~1, usage == null ? 0 : usage.ptr & ~1); Reference.reachabilityFence(this); Reference.reachabilityFence(short_channel_id); - Reference.reachabilityFence(send_amt_msat); - Reference.reachabilityFence(capacity_msat); Reference.reachabilityFence(source); Reference.reachabilityFence(target); + Reference.reachabilityFence(usage); this.ptrs_to.add(source); this.ptrs_to.add(target); return ret; diff --git a/src/main/java/org/ldk/structs/Scorer.java b/src/main/java/org/ldk/structs/Scorer.java deleted file mode 100644 index 4ec2a7b8..00000000 --- a/src/main/java/org/ldk/structs/Scorer.java +++ /dev/null @@ -1,91 +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; - - -/** - * [`Score`] implementation that provides reasonable default behavior. - * - * Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with - * slightly higher fees are available. Will further penalize channels that fail to relay payments. - * - * See [module-level documentation] for usage and [`ScoringParameters`] for customization. - * - * # Note - * - * Mixing the `no-std` feature between serialization and deserialization results in undefined - * behavior. - * - * [module-level documentation]: crate::routing::scoring - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class Scorer extends CommonBase { - Scorer(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.Scorer_free(ptr); } - } - - /** - * Creates a new scorer using the given scoring parameters. - */ - public static Scorer of(ScoringParameters params) { - long ret = bindings.Scorer_new(params == null ? 0 : params.ptr & ~1); - Reference.reachabilityFence(params); - if (ret >= 0 && ret <= 4096) { return null; } - Scorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Scorer(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); - return ret_hu_conv; - } - - /** - * Creates a "default" Scorer. See struct and individual field documentaiton for details on which values are used. - */ - public static Scorer with_default() { - long ret = bindings.Scorer_default(); - if (ret >= 0 && ret <= 4096) { return null; } - Scorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Scorer(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); - return ret_hu_conv; - } - - /** - * Constructs a new Score which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is - */ - public Score as_Score() { - long ret = bindings.Scorer_as_Score(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Score ret_hu_conv = new Score(null, ret); - ret_hu_conv.ptrs_to.add(this); - return ret_hu_conv; - } - - /** - * Serialize the Scorer object into a byte array which can be read by Scorer_read - */ - public byte[] write() { - byte[] ret = bindings.Scorer_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a Scorer from a byte array, created by Scorer_write - */ - public static Result_ScorerDecodeErrorZ read(byte[] ser) { - long ret = bindings.Scorer_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/ScoringParameters.java b/src/main/java/org/ldk/structs/ScoringParameters.java deleted file mode 100644 index 5a80f7a5..00000000 --- a/src/main/java/org/ldk/structs/ScoringParameters.java +++ /dev/null @@ -1,242 +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; - - -/** - * Parameters for configuring [`Scorer`]. - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class ScoringParameters extends CommonBase { - ScoringParameters(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ScoringParameters_free(ptr); } - } - - /** - * A fixed penalty in msats to apply to each channel. - * - * Default value: 500 msat - */ - public long get_base_penalty_msat() { - long ret = bindings.ScoringParameters_get_base_penalty_msat(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * A fixed penalty in msats to apply to each channel. - * - * Default value: 500 msat - */ - public void set_base_penalty_msat(long val) { - bindings.ScoringParameters_set_base_penalty_msat(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * A penalty in msats to apply to a channel upon failing to relay a payment. - * - * This accumulates for each failure but may be reduced over time based on - * [`failure_penalty_half_life`] or when successfully routing through a channel. - * - * Default value: 1,024,000 msat - * - * [`failure_penalty_half_life`]: Self::failure_penalty_half_life - */ - public long get_failure_penalty_msat() { - long ret = bindings.ScoringParameters_get_failure_penalty_msat(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * A penalty in msats to apply to a channel upon failing to relay a payment. - * - * This accumulates for each failure but may be reduced over time based on - * [`failure_penalty_half_life`] or when successfully routing through a channel. - * - * Default value: 1,024,000 msat - * - * [`failure_penalty_half_life`]: Self::failure_penalty_half_life - */ - public void set_failure_penalty_msat(long val) { - bindings.ScoringParameters_set_failure_penalty_msat(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * When the amount being sent over a channel is this many 1024ths of the total channel - * capacity, we begin applying [`overuse_penalty_msat_per_1024th`]. - * - * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel) - * - * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th - */ - public short get_overuse_penalty_start_1024th() { - short ret = bindings.ScoringParameters_get_overuse_penalty_start_1024th(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * When the amount being sent over a channel is this many 1024ths of the total channel - * capacity, we begin applying [`overuse_penalty_msat_per_1024th`]. - * - * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel) - * - * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th - */ - public void set_overuse_penalty_start_1024th(short val) { - bindings.ScoringParameters_set_overuse_penalty_start_1024th(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent - * over the channel exceeds [`overuse_penalty_start_1024th`] by. - * - * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty - * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel) - * - * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th - */ - public long get_overuse_penalty_msat_per_1024th() { - long ret = bindings.ScoringParameters_get_overuse_penalty_msat_per_1024th(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent - * over the channel exceeds [`overuse_penalty_start_1024th`] by. - * - * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty - * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel) - * - * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th - */ - public void set_overuse_penalty_msat_per_1024th(long val) { - bindings.ScoringParameters_set_overuse_penalty_msat_per_1024th(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are - * cut in half. - * - * Successfully routing through a channel will immediately cut the penalty in half as well. - * - * Default value: 1 hour - * - * # Note - * - * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will - * never decay. - * - * [`failure_penalty_msat`]: Self::failure_penalty_msat - */ - public long get_failure_penalty_half_life() { - long ret = bindings.ScoringParameters_get_failure_penalty_half_life(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are - * cut in half. - * - * Successfully routing through a channel will immediately cut the penalty in half as well. - * - * Default value: 1 hour - * - * # Note - * - * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will - * never decay. - * - * [`failure_penalty_msat`]: Self::failure_penalty_msat - */ - public void set_failure_penalty_half_life(long val) { - bindings.ScoringParameters_set_failure_penalty_half_life(this.ptr, val); - Reference.reachabilityFence(this); - Reference.reachabilityFence(val); - } - - /** - * Constructs a new ScoringParameters given each field - */ - public static ScoringParameters of(long base_penalty_msat_arg, long failure_penalty_msat_arg, short overuse_penalty_start_1024th_arg, long overuse_penalty_msat_per_1024th_arg, long failure_penalty_half_life_arg) { - long ret = bindings.ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg); - Reference.reachabilityFence(base_penalty_msat_arg); - Reference.reachabilityFence(failure_penalty_msat_arg); - Reference.reachabilityFence(overuse_penalty_start_1024th_arg); - Reference.reachabilityFence(overuse_penalty_msat_per_1024th_arg); - Reference.reachabilityFence(failure_penalty_half_life_arg); - if (ret >= 0 && ret <= 4096) { return null; } - ScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ScoringParameters(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); - return ret_hu_conv; - } - - long clone_ptr() { - long ret = bindings.ScoringParameters_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a copy of the ScoringParameters - */ - public ScoringParameters clone() { - long ret = bindings.ScoringParameters_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - ScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ScoringParameters(null, ret); } - ret_hu_conv.ptrs_to.add(this); - return ret_hu_conv; - } - - /** - * Serialize the ScoringParameters object into a byte array which can be read by ScoringParameters_read - */ - public byte[] write() { - byte[] ret = bindings.ScoringParameters_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a ScoringParameters from a byte array, created by ScoringParameters_write - */ - public static Result_ScoringParametersDecodeErrorZ read(byte[] ser) { - long ret = bindings.ScoringParameters_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a "default" ScoringParameters. See struct and individual field documentaiton for details on which values are used. - */ - public static ScoringParameters with_default() { - long ret = bindings.ScoringParameters_default(); - if (ret >= 0 && ret <= 4096) { return null; } - ScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ScoringParameters(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Sha256.java b/src/main/java/org/ldk/structs/Sha256.java index 58497f1d..4112c44f 100644 --- a/src/main/java/org/ldk/structs/Sha256.java +++ b/src/main/java/org/ldk/structs/Sha256.java @@ -33,7 +33,7 @@ public class Sha256 extends CommonBase { long ret = bindings.Sha256_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); } + org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Shutdown.java b/src/main/java/org/ldk/structs/Shutdown.java index 2245c11b..0eb44625 100644 --- a/src/main/java/org/ldk/structs/Shutdown.java +++ b/src/main/java/org/ldk/structs/Shutdown.java @@ -66,7 +66,7 @@ public class Shutdown extends CommonBase { Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(scriptpubkey_arg); if (ret >= 0 && ret <= 4096) { return null; } - Shutdown ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Shutdown(null, ret); } + org.ldk.structs.Shutdown ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Shutdown(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -84,7 +84,7 @@ public class Shutdown extends CommonBase { long ret = bindings.Shutdown_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - Shutdown ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Shutdown(null, ret); } + org.ldk.structs.Shutdown ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Shutdown(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ShutdownScript.java b/src/main/java/org/ldk/structs/ShutdownScript.java index f180526c..3934068a 100644 --- a/src/main/java/org/ldk/structs/ShutdownScript.java +++ b/src/main/java/org/ldk/structs/ShutdownScript.java @@ -11,7 +11,7 @@ import javax.annotation.Nullable; /** * A script pubkey for shutting down a channel as defined by [BOLT #2]. * - * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md + * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class ShutdownScript extends CommonBase { @@ -35,7 +35,7 @@ public class ShutdownScript extends CommonBase { long ret = bindings.ShutdownScript_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); } + org.ldk.structs.ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ShutdownScript(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -67,7 +67,7 @@ public class ShutdownScript extends CommonBase { long ret = bindings.ShutdownScript_new_p2wpkh(InternalUtils.check_arr_len(pubkey_hash, 20)); Reference.reachabilityFence(pubkey_hash); if (ret >= 0 && ret <= 4096) { return null; } - ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); } + org.ldk.structs.ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ShutdownScript(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -79,7 +79,7 @@ public class ShutdownScript extends CommonBase { long ret = bindings.ShutdownScript_new_p2wsh(InternalUtils.check_arr_len(script_hash, 32)); Reference.reachabilityFence(script_hash); if (ret >= 0 && ret <= 4096) { return null; } - ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); } + org.ldk.structs.ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ShutdownScript(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -94,8 +94,8 @@ public class ShutdownScript extends CommonBase { * * This function may return an error if `program` is invalid for the segwit `version`. */ - public static Result_ShutdownScriptInvalidShutdownScriptZ new_witness_program(byte version, byte[] program) { - long ret = bindings.ShutdownScript_new_witness_program(version, program); + public static Result_ShutdownScriptInvalidShutdownScriptZ new_witness_program(WitnessVersion version, byte[] program) { + long ret = bindings.ShutdownScript_new_witness_program(version.getVal(), program); Reference.reachabilityFence(version); Reference.reachabilityFence(program); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/SignedRawInvoice.java b/src/main/java/org/ldk/structs/SignedRawInvoice.java index 5325d42f..15b52b61 100644 --- a/src/main/java/org/ldk/structs/SignedRawInvoice.java +++ b/src/main/java/org/ldk/structs/SignedRawInvoice.java @@ -54,7 +54,7 @@ public class SignedRawInvoice extends CommonBase { long ret = bindings.SignedRawInvoice_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new SignedRawInvoice(null, ret); } + org.ldk.structs.SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SignedRawInvoice(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -82,7 +82,7 @@ public class SignedRawInvoice extends CommonBase { long ret = bindings.SignedRawInvoice_raw_invoice(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); } + org.ldk.structs.RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawInvoice(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -103,7 +103,7 @@ public class SignedRawInvoice extends CommonBase { long ret = bindings.SignedRawInvoice_signature(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceSignature(null, ret); } + org.ldk.structs.InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceSignature(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java index 40d06ee0..49c9d226 100644 --- a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java @@ -56,7 +56,7 @@ public class SpendableOutputDescriptor extends CommonBase { private StaticOutput(long ptr, bindings.LDKSpendableOutputDescriptor.StaticOutput obj) { super(null, ptr); long outpoint = obj.outpoint; - OutPoint outpoint_hu_conv = null; if (outpoint < 0 || outpoint > 4096) { outpoint_hu_conv = new OutPoint(null, outpoint); } + org.ldk.structs.OutPoint outpoint_hu_conv = null; if (outpoint < 0 || outpoint > 4096) { outpoint_hu_conv = new org.ldk.structs.OutPoint(null, outpoint); } outpoint_hu_conv.ptrs_to.add(this); this.outpoint = outpoint_hu_conv; long output = obj.output; @@ -99,7 +99,7 @@ public class SpendableOutputDescriptor extends CommonBase { private DelayedPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput obj) { super(null, ptr); long delayed_payment_output = obj.delayed_payment_output; - DelayedPaymentOutputDescriptor delayed_payment_output_hu_conv = null; if (delayed_payment_output < 0 || delayed_payment_output > 4096) { delayed_payment_output_hu_conv = new DelayedPaymentOutputDescriptor(null, delayed_payment_output); } + org.ldk.structs.DelayedPaymentOutputDescriptor delayed_payment_output_hu_conv = null; if (delayed_payment_output < 0 || delayed_payment_output > 4096) { delayed_payment_output_hu_conv = new org.ldk.structs.DelayedPaymentOutputDescriptor(null, delayed_payment_output); } delayed_payment_output_hu_conv.ptrs_to.add(this); this.delayed_payment_output = delayed_payment_output_hu_conv; } @@ -118,7 +118,7 @@ public class SpendableOutputDescriptor extends CommonBase { private StaticPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput obj) { super(null, ptr); long static_payment_output = obj.static_payment_output; - StaticPaymentOutputDescriptor static_payment_output_hu_conv = null; if (static_payment_output < 0 || static_payment_output > 4096) { static_payment_output_hu_conv = new StaticPaymentOutputDescriptor(null, static_payment_output); } + org.ldk.structs.StaticPaymentOutputDescriptor static_payment_output_hu_conv = null; if (static_payment_output < 0 || static_payment_output > 4096) { static_payment_output_hu_conv = new org.ldk.structs.StaticPaymentOutputDescriptor(null, static_payment_output); } static_payment_output_hu_conv.ptrs_to.add(this); this.static_payment_output = static_payment_output_hu_conv; } diff --git a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java index e8dfdfa2..ac9c3787 100644 --- a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java @@ -28,7 +28,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase { long ret = bindings.StaticPaymentOutputDescriptor_get_outpoint(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -101,7 +101,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase { Reference.reachabilityFence(channel_keys_id_arg); Reference.reachabilityFence(channel_value_satoshis_arg); if (ret >= 0 && ret <= 4096) { return null; } - StaticPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret); } + org.ldk.structs.StaticPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.StaticPaymentOutputDescriptor(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -119,7 +119,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase { long ret = bindings.StaticPaymentOutputDescriptor_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - StaticPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret); } + org.ldk.structs.StaticPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.StaticPaymentOutputDescriptor(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java b/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java index d0fa79c9..691cb670 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java @@ -27,7 +27,7 @@ public class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); } + org.ldk.structs.ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -39,7 +39,7 @@ public class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); } + org.ldk.structs.ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -51,7 +51,7 @@ public class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); } + org.ldk.structs.ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java b/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java index 496c1ac0..b08a644e 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java @@ -27,7 +27,7 @@ public class ThreeTuple_RawInvoice_u832InvoiceSignatureZ extends CommonBase { long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); } + org.ldk.structs.RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawInvoice(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -48,7 +48,7 @@ public class ThreeTuple_RawInvoice_u832InvoiceSignatureZ extends CommonBase { long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceSignature(null, ret); } + org.ldk.structs.InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceSignature(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java index eec574dd..05069a80 100644 --- a/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java @@ -41,7 +41,7 @@ public class TrustedCommitmentTransaction extends CommonBase { long ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BuiltCommitmentTransaction(null, ret); } + org.ldk.structs.BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BuiltCommitmentTransaction(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -53,7 +53,7 @@ public class TrustedCommitmentTransaction extends CommonBase { long ret = bindings.TrustedCommitmentTransaction_keys(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TxCreationKeys(null, ret); } + org.ldk.structs.TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxCreationKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -73,7 +73,7 @@ public class TrustedCommitmentTransaction extends CommonBase { * * The returned Vec has one entry for each HTLC, and in the same order. * - * This function is only valid in the holder commitment context, it always uses SigHashType::All. + * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All. */ public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters) { long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr & ~1); diff --git a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java index 41a818c7..1144ada9 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java @@ -36,7 +36,7 @@ public class TwoTuple_BlockHashChannelManagerZ extends CommonBase { long ret = bindings.C2Tuple_BlockHashChannelManagerZ_get_b(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelManager(null, ret); } + org.ldk.structs.ChannelManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelManager(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java index 1d67dbb8..4a322a3b 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java @@ -36,7 +36,7 @@ public class TwoTuple_BlockHashChannelMonitorZ extends CommonBase { long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_get_b(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelMonitor(null, ret); } + org.ldk.structs.ChannelMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelMonitor(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorEventZZ.java b/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorEventZZ.java new file mode 100644 index 00000000..1e3b9b29 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorEventZZ.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_OutPointCVec_MonitorEventZZ extends CommonBase { + TwoTuple_OutPointCVec_MonitorEventZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_OutPointCVec_MonitorEventZZ_free(ptr); } + } + + /** + * + */ + public OutPoint get_a() { + long ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * + */ + public MonitorEvent[] get_b() { + long[] ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_get_b(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_14_len = ret.length; + MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret_conv_14_len]; + for (int o = 0; o < ret_conv_14_len; o++) { + long ret_conv_14 = ret[o]; + org.ldk.structs.MonitorEvent ret_conv_14_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret_conv_14); + ret_conv_14_hu_conv.ptrs_to.add(this); + ret_conv_14_arr[o] = ret_conv_14_hu_conv; + } + return ret_conv_14_arr; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_OutPointCVec_MonitorEventZZ clone() { + long ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointCVec_MonitorEventZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorEventZZ(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OutPointCVec_MonitorEventZZ from the contained elements. + */ + public static TwoTuple_OutPointCVec_MonitorEventZZ of(OutPoint a, MonitorEvent[] b) { + long ret = bindings.C2Tuple_OutPointCVec_MonitorEventZZ_new(a == null ? 0 : a.ptr & ~1, b != null ? Arrays.stream(b).mapToLong(b_conv_14 -> b_conv_14.ptr).toArray() : null); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointCVec_MonitorEventZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorEventZZ(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java b/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java index 28bde7bb..1f65d4f2 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java @@ -27,7 +27,7 @@ public class TwoTuple_OutPointScriptZ extends CommonBase { long ret = bindings.C2Tuple_OutPointScriptZ_get_a(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/TxCreationKeys.java b/src/main/java/org/ldk/structs/TxCreationKeys.java index f1e78509..00211fc0 100644 --- a/src/main/java/org/ldk/structs/TxCreationKeys.java +++ b/src/main/java/org/ldk/structs/TxCreationKeys.java @@ -135,7 +135,7 @@ public class TxCreationKeys extends CommonBase { Reference.reachabilityFence(countersignatory_htlc_key_arg); Reference.reachabilityFence(broadcaster_delayed_payment_key_arg); if (ret >= 0 && ret <= 4096) { return null; } - TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TxCreationKeys(null, ret); } + org.ldk.structs.TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxCreationKeys(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -153,7 +153,7 @@ public class TxCreationKeys extends CommonBase { long ret = bindings.TxCreationKeys_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TxCreationKeys(null, ret); } + org.ldk.structs.TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxCreationKeys(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java index 58b5d170..93460fe6 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java @@ -27,7 +27,7 @@ public class UnsignedChannelAnnouncement extends CommonBase { long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); } + org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -162,7 +162,7 @@ public class UnsignedChannelAnnouncement extends CommonBase { long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); } + org.ldk.structs.UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java index 8ef49b9e..1d3f2d72 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java @@ -178,6 +178,17 @@ public class UnsignedChannelUpdate extends CommonBase { Reference.reachabilityFence(val); } + /** + * Excess data which was signed as a part of the message which we do not (yet) understand how + * to decode. This is stored to ensure forward-compatibility as new fields are added to the + * lightning gossip + */ + public void set_excess_data(byte[] val) { + bindings.UnsignedChannelUpdate_set_excess_data(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + long clone_ptr() { long ret = bindings.UnsignedChannelUpdate_clone_ptr(this.ptr); Reference.reachabilityFence(this); @@ -191,7 +202,7 @@ public class UnsignedChannelUpdate extends CommonBase { long ret = bindings.UnsignedChannelUpdate_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelUpdate(null, ret); } + org.ldk.structs.UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedChannelUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java index 7c6c614e..22708cd1 100644 --- a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java @@ -27,7 +27,7 @@ public class UnsignedNodeAnnouncement extends CommonBase { long ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); } + org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -139,7 +139,7 @@ public class UnsignedNodeAnnouncement extends CommonBase { long ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); } + org.ldk.structs.UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedNodeAnnouncement(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UpdateAddHTLC.java b/src/main/java/org/ldk/structs/UpdateAddHTLC.java index d8944493..6ada3510 100644 --- a/src/main/java/org/ldk/structs/UpdateAddHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateAddHTLC.java @@ -123,7 +123,7 @@ public class UpdateAddHTLC extends CommonBase { long ret = bindings.UpdateAddHTLC_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UpdateAddHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateAddHTLC(null, ret); } + org.ldk.structs.UpdateAddHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateAddHTLC(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UpdateFailHTLC.java b/src/main/java/org/ldk/structs/UpdateFailHTLC.java index 62b6cdeb..07afe7b5 100644 --- a/src/main/java/org/ldk/structs/UpdateFailHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailHTLC.java @@ -69,7 +69,7 @@ public class UpdateFailHTLC extends CommonBase { long ret = bindings.UpdateFailHTLC_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UpdateFailHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFailHTLC(null, ret); } + org.ldk.structs.UpdateFailHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFailHTLC(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java index a1961cc7..28c8ef52 100644 --- a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java @@ -87,7 +87,7 @@ public class UpdateFailMalformedHTLC extends CommonBase { long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UpdateFailMalformedHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFailMalformedHTLC(null, ret); } + org.ldk.structs.UpdateFailMalformedHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFailMalformedHTLC(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UpdateFee.java b/src/main/java/org/ldk/structs/UpdateFee.java index 07911b5e..f4578397 100644 --- a/src/main/java/org/ldk/structs/UpdateFee.java +++ b/src/main/java/org/ldk/structs/UpdateFee.java @@ -64,7 +64,7 @@ public class UpdateFee extends CommonBase { Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(feerate_per_kw_arg); if (ret >= 0 && ret <= 4096) { return null; } - UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFee(null, ret); } + org.ldk.structs.UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFee(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -82,7 +82,7 @@ public class UpdateFee extends CommonBase { long ret = bindings.UpdateFee_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFee(null, ret); } + org.ldk.structs.UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFee(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java index 7236463b..74104034 100644 --- a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java @@ -83,7 +83,7 @@ public class UpdateFulfillHTLC extends CommonBase { Reference.reachabilityFence(htlc_id_arg); Reference.reachabilityFence(payment_preimage_arg); if (ret >= 0 && ret <= 4096) { return null; } - UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFulfillHTLC(null, ret); } + org.ldk.structs.UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFulfillHTLC(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -101,7 +101,7 @@ public class UpdateFulfillHTLC extends CommonBase { long ret = bindings.UpdateFulfillHTLC_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFulfillHTLC(null, ret); } + org.ldk.structs.UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFulfillHTLC(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UserConfig.java b/src/main/java/org/ldk/structs/UserConfig.java index 0f7bff7b..455fb1d7 100644 --- a/src/main/java/org/ldk/structs/UserConfig.java +++ b/src/main/java/org/ldk/structs/UserConfig.java @@ -30,7 +30,7 @@ public class UserConfig extends CommonBase { long ret = bindings.UserConfig_get_own_channel_config(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); } + org.ldk.structs.ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -51,7 +51,7 @@ public class UserConfig extends CommonBase { long ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeLimits(null, ret); } + org.ldk.structs.ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeLimits(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -72,7 +72,7 @@ public class UserConfig extends CommonBase { long ret = bindings.UserConfig_get_channel_options(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelConfig(null, ret); } + org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -208,7 +208,7 @@ public class UserConfig extends CommonBase { Reference.reachabilityFence(accept_inbound_channels_arg); Reference.reachabilityFence(manually_accept_inbound_channels_arg); if (ret >= 0 && ret <= 4096) { return null; } - UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); } + org.ldk.structs.UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UserConfig(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -226,7 +226,7 @@ public class UserConfig extends CommonBase { long ret = bindings.UserConfig_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); } + org.ldk.structs.UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UserConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -237,7 +237,7 @@ public class UserConfig extends CommonBase { public static UserConfig with_default() { long ret = bindings.UserConfig_default(); if (ret >= 0 && ret <= 4096) { return null; } - UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); } + org.ldk.structs.UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UserConfig(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/UtilMethods.java b/src/main/java/org/ldk/structs/UtilMethods.java index 7c53034a..bbb6689d 100644 --- a/src/main/java/org/ldk/structs/UtilMethods.java +++ b/src/main/java/org/ldk/structs/UtilMethods.java @@ -142,6 +142,55 @@ public class UtilMethods { return ret_hu_conv; } + /** + * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no + * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without + * a `ChannelManager`. + * + * `keys` is generated by calling [`KeysInterface::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. + * + * `current_time` is a Unix timestamp representing the current time. + * + * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager + */ + public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create(ExpandedKey keys, Option_u64Z min_value_msat, int invoice_expiry_delta_secs, KeysInterface keys_manager, long current_time) { + long ret = bindings.create(keys == null ? 0 : keys.ptr & ~1, min_value_msat.ptr, invoice_expiry_delta_secs, keys_manager == null ? 0 : keys_manager.ptr, current_time); + Reference.reachabilityFence(keys); + Reference.reachabilityFence(min_value_msat); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(keys_manager); + Reference.reachabilityFence(current_time); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(keys); + ret_hu_conv.ptrs_to.add(keys_manager); + return ret_hu_conv; + } + + /** + * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`], + * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments] + * without a `ChannelManager`. + * + * See [`create`] for information on the `keys` and `current_time` parameters. + * + * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager + */ + public static Result_PaymentSecretNoneZ create_from_hash(ExpandedKey keys, Option_u64Z min_value_msat, byte[] payment_hash, int invoice_expiry_delta_secs, long current_time) { + long ret = bindings.create_from_hash(keys == null ? 0 : keys.ptr & ~1, min_value_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), invoice_expiry_delta_secs, current_time); + Reference.reachabilityFence(keys); + Reference.reachabilityFence(min_value_msat); + Reference.reachabilityFence(payment_hash); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(current_time); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(keys); + return ret_hu_conv; + } + /** * Gets the weight for an HTLC-Success transaction. */ @@ -365,8 +414,8 @@ public class UtilMethods { * Private routing paths between a public node and the target may be included in `params.payee`. * * If some channels aren't announced, it may be useful to fill in `first_hops` with the results - * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of our local - * channels from [`NetworkGraph`] will be ignored, and only those in `first_hops` will be used. + * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels + * from `network_graph` will be ignored, and only those in `first_hops` will be used. * * The fees on channels from us to the next hop are ignored as they are assumed to all be equal. * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` / @@ -385,14 +434,15 @@ public class UtilMethods { * * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph * * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, RouteParameters route_params, NetworkGraph network, @Nullable ChannelDetails[] first_hops, Logger logger, Score scorer, byte[] random_seed_bytes) { - long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params == null ? 0 : route_params.ptr & ~1, network == null ? 0 : network.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); + public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, RouteParameters route_params, NetworkGraph network_graph, @Nullable ChannelDetails[] first_hops, Logger logger, Score scorer, byte[] random_seed_bytes) { + long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params == null ? 0 : route_params.ptr & ~1, network_graph == null ? 0 : network_graph.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); Reference.reachabilityFence(our_node_pubkey); Reference.reachabilityFence(route_params); - Reference.reachabilityFence(network); + Reference.reachabilityFence(network_graph); Reference.reachabilityFence(first_hops); Reference.reachabilityFence(logger); Reference.reachabilityFence(scorer); @@ -400,7 +450,7 @@ public class UtilMethods { if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(route_params); - ret_hu_conv.ptrs_to.add(network); + ret_hu_conv.ptrs_to.add(network_graph); for (ChannelDetails first_hops_conv_16: first_hops) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); }; ret_hu_conv.ptrs_to.add(logger); ret_hu_conv.ptrs_to.add(scorer); @@ -408,30 +458,24 @@ public class UtilMethods { } /** - * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister` - * initialization, within a file called \"manager\". - */ - public static Result_NoneErrorZ FilesystemPersister_persist_manager(java.lang.String data_dir, ChannelManager manager) { - long ret = bindings.FilesystemPersister_persist_manager(data_dir, manager == null ? 0 : manager.ptr & ~1); - Reference.reachabilityFence(data_dir); - Reference.reachabilityFence(manager); - if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(manager); - return ret_hu_conv; - } - - /** - * Write the provided `NetworkGraph` to the path provided at `FilesystemPersister` - * initialization, within a file called \"network_graph\" + * Construct a route from us (payer) to the target node (payee) via the given hops (which should + * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path. + * + * Re-uses logic from `find_route`, so the restrictions described there also apply here. */ - public static Result_NoneErrorZ FilesystemPersister_persist_network_graph(java.lang.String data_dir, NetworkGraph network_graph) { - long ret = bindings.FilesystemPersister_persist_network_graph(data_dir, network_graph == null ? 0 : network_graph.ptr & ~1); - Reference.reachabilityFence(data_dir); + public static Result_RouteLightningErrorZ build_route_from_hops(byte[] our_node_pubkey, byte[][] hops, RouteParameters route_params, NetworkGraph network_graph, Logger logger, byte[] random_seed_bytes) { + long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? Arrays.stream(hops).map(hops_conv_8 -> InternalUtils.check_arr_len(hops_conv_8, 33)).toArray(byte[][]::new) : null, route_params == null ? 0 : route_params.ptr & ~1, network_graph == null ? 0 : network_graph.ptr & ~1, logger == null ? 0 : logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); + Reference.reachabilityFence(our_node_pubkey); + Reference.reachabilityFence(hops); + Reference.reachabilityFence(route_params); Reference.reachabilityFence(network_graph); + Reference.reachabilityFence(logger); + Reference.reachabilityFence(random_seed_bytes); if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret); + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(route_params); ret_hu_conv.ptrs_to.add(network_graph); + ret_hu_conv.ptrs_to.add(logger); return ret_hu_conv; } @@ -449,9 +493,12 @@ public class UtilMethods { * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared * down * - * `payment_hash` and `payment_secret` come from [`ChannelManager::create_inbound_payment`] or - * [`ChannelManager::create_inbound_payment_for_hash`]. These values can be retrieved from any - * participating node. + * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference + * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). + * If `None` is provided for `payment_hash`, then one will be created. + * + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. * * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this @@ -459,14 +506,18 @@ public class UtilMethods { * * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints + * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment + * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels + * + * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice(Option_u64Z amt_msat, java.lang.String description, byte[] payment_hash, byte[] payment_secret, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, org.ldk.enums.Currency network) { - long ret = bindings.create_phantom_invoice(amt_msat.ptr, description, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32), phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr & ~1).toArray() : null, keys_manager == null ? 0 : keys_manager.ptr, network); + public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice(Option_u64Z amt_msat, @Nullable byte[] payment_hash, java.lang.String description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, org.ldk.enums.Currency network) { + long ret = bindings.create_phantom_invoice(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), 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 == null ? 0 : phantom_route_hints_conv_19.ptr & ~1).toArray() : null, keys_manager == null ? 0 : keys_manager.ptr, network); Reference.reachabilityFence(amt_msat); - Reference.reachabilityFence(description); Reference.reachabilityFence(payment_hash); - Reference.reachabilityFence(payment_secret); + Reference.reachabilityFence(description); + Reference.reachabilityFence(invoice_expiry_delta_secs); Reference.reachabilityFence(phantom_route_hints); Reference.reachabilityFence(keys_manager); Reference.reachabilityFence(network); @@ -492,9 +543,12 @@ public class UtilMethods { * * `description_hash` is a SHA-256 hash of the description text * - * `payment_hash` and `payment_secret` come from [`ChannelManager::create_inbound_payment`] or - * [`ChannelManager::create_inbound_payment_for_hash`]. These values can be retrieved from any - * participating node. + * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference + * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]). + * If `None` is provided for `payment_hash`, then one will be created. + * + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. * * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this @@ -502,14 +556,18 @@ public class UtilMethods { * * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints + * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment + * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels + * + * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(Option_u64Z amt_msat, Sha256 description_hash, byte[] payment_hash, byte[] payment_secret, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, org.ldk.enums.Currency network) { - long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32), phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr & ~1).toArray() : null, keys_manager == null ? 0 : keys_manager.ptr, network); + public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(Option_u64Z amt_msat, @Nullable byte[] payment_hash, int invoice_expiry_delta_secs, Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, org.ldk.enums.Currency network) { + long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), invoice_expiry_delta_secs, description_hash == null ? 0 : description_hash.ptr & ~1, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr & ~1).toArray() : null, keys_manager == null ? 0 : keys_manager.ptr, network); Reference.reachabilityFence(amt_msat); - Reference.reachabilityFence(description_hash); Reference.reachabilityFence(payment_hash); - Reference.reachabilityFence(payment_secret); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(description_hash); Reference.reachabilityFence(phantom_route_hints); Reference.reachabilityFence(keys_manager); Reference.reachabilityFence(network); @@ -525,14 +583,18 @@ public class UtilMethods { * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify * that the payment secret is valid when the invoice is paid. + * + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. */ - public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description) { - long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description); + public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description, int invoice_expiry_delta_secs) { + long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs); Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(keys_manager); Reference.reachabilityFence(network); Reference.reachabilityFence(amt_msat); Reference.reachabilityFence(description); + Reference.reachabilityFence(invoice_expiry_delta_secs); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(channelmanager); @@ -547,14 +609,18 @@ public class UtilMethods { * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify * that the payment secret is valid when the invoice is paid. * Use this variant if you want to pass the `description_hash` to the invoice. + * + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. */ - public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash) { - long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr & ~1); + public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash, int invoice_expiry_delta_secs) { + long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr & ~1, invoice_expiry_delta_secs); Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(keys_manager); Reference.reachabilityFence(network); Reference.reachabilityFence(amt_msat); Reference.reachabilityFence(description_hash); + Reference.reachabilityFence(invoice_expiry_delta_secs); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(channelmanager); @@ -567,14 +633,15 @@ public class UtilMethods { * 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_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash, long duration_since_epoch) { - long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr & ~1, duration_since_epoch); + public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs) { + long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr & ~1, duration_since_epoch, invoice_expiry_delta_secs); Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(keys_manager); Reference.reachabilityFence(network); Reference.reachabilityFence(amt_msat); Reference.reachabilityFence(description_hash); Reference.reachabilityFence(duration_since_epoch); + Reference.reachabilityFence(invoice_expiry_delta_secs); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(channelmanager); @@ -587,14 +654,15 @@ public class UtilMethods { * 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_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch) { - long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description, duration_since_epoch); + public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs) { + long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs); Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(keys_manager); Reference.reachabilityFence(network); Reference.reachabilityFence(amt_msat); Reference.reachabilityFence(description); Reference.reachabilityFence(duration_since_epoch); + Reference.reachabilityFence(invoice_expiry_delta_secs); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(channelmanager); diff --git a/src/main/java/org/ldk/structs/WarningMessage.java b/src/main/java/org/ldk/structs/WarningMessage.java index 662d479d..1581e3cd 100644 --- a/src/main/java/org/ldk/structs/WarningMessage.java +++ b/src/main/java/org/ldk/structs/WarningMessage.java @@ -74,7 +74,7 @@ public class WarningMessage extends CommonBase { Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(data_arg); if (ret >= 0 && ret <= 4096) { return null; } - WarningMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new WarningMessage(null, ret); } + org.ldk.structs.WarningMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WarningMessage(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -92,7 +92,7 @@ public class WarningMessage extends CommonBase { long ret = bindings.WarningMessage_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - WarningMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new WarningMessage(null, ret); } + org.ldk.structs.WarningMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WarningMessage(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/Watch.java b/src/main/java/org/ldk/structs/Watch.java index 8888d28d..1a671bc1 100644 --- a/src/main/java/org/ldk/structs/Watch.java +++ b/src/main/java/org/ldk/structs/Watch.java @@ -78,16 +78,16 @@ public class Watch extends CommonBase { * For details on asynchronous [`ChannelMonitor`] updating and returning * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`]. */ - MonitorEvent[] release_pending_monitor_events(); + TwoTuple_OutPointCVec_MonitorEventZZ[] release_pending_monitor_events(); } private static class LDKWatchHolder { Watch held; } public static Watch new_impl(WatchInterface arg) { final LDKWatchHolder impl_holder = new LDKWatchHolder(); impl_holder.held = new Watch(new bindings.LDKWatch() { @Override public long watch_channel(long funding_txo, long monitor) { - OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new OutPoint(null, funding_txo); } + org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); } funding_txo_hu_conv.ptrs_to.add(this); - ChannelMonitor monitor_hu_conv = null; if (monitor < 0 || monitor > 4096) { monitor_hu_conv = new ChannelMonitor(null, monitor); } + org.ldk.structs.ChannelMonitor monitor_hu_conv = null; if (monitor < 0 || monitor > 4096) { monitor_hu_conv = new org.ldk.structs.ChannelMonitor(null, monitor); } monitor_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.watch_channel(funding_txo_hu_conv, monitor_hu_conv); Reference.reachabilityFence(arg); @@ -95,9 +95,9 @@ public class Watch extends CommonBase { return result; } @Override public long update_channel(long funding_txo, long update) { - OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new OutPoint(null, funding_txo); } + org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); } funding_txo_hu_conv.ptrs_to.add(this); - ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new ChannelMonitorUpdate(null, update); } + org.ldk.structs.ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, update); } update_hu_conv.ptrs_to.add(this); Result_NoneChannelMonitorUpdateErrZ ret = arg.update_channel(funding_txo_hu_conv, update_hu_conv); Reference.reachabilityFence(arg); @@ -105,9 +105,9 @@ public class Watch extends CommonBase { return result; } @Override public long[] release_pending_monitor_events() { - MonitorEvent[] ret = arg.release_pending_monitor_events(); + TwoTuple_OutPointCVec_MonitorEventZZ[] ret = arg.release_pending_monitor_events(); Reference.reachabilityFence(arg); - long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_14 -> ret_conv_14 == null ? 0 : ret_conv_14.clone_ptr()).toArray() : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_38 -> ret_conv_38 == null ? 0 : ret_conv_38.clone_ptr()).toArray() : null; return result; } }); @@ -166,18 +166,18 @@ public class Watch extends CommonBase { * For details on asynchronous [`ChannelMonitor`] updating and returning * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`]. */ - public MonitorEvent[] release_pending_monitor_events() { + public TwoTuple_OutPointCVec_MonitorEventZZ[] release_pending_monitor_events() { long[] ret = bindings.Watch_release_pending_monitor_events(this.ptr); Reference.reachabilityFence(this); - int ret_conv_14_len = ret.length; - MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret_conv_14_len]; - for (int o = 0; o < ret_conv_14_len; o++) { - long ret_conv_14 = ret[o]; - org.ldk.structs.MonitorEvent ret_conv_14_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret_conv_14); - ret_conv_14_hu_conv.ptrs_to.add(this); - ret_conv_14_arr[o] = ret_conv_14_hu_conv; + int ret_conv_38_len = ret.length; + TwoTuple_OutPointCVec_MonitorEventZZ[] ret_conv_38_arr = new TwoTuple_OutPointCVec_MonitorEventZZ[ret_conv_38_len]; + for (int m = 0; m < ret_conv_38_len; m++) { + long ret_conv_38 = ret[m]; + TwoTuple_OutPointCVec_MonitorEventZZ ret_conv_38_hu_conv = new TwoTuple_OutPointCVec_MonitorEventZZ(null, ret_conv_38); + ret_conv_38_hu_conv.ptrs_to.add(this); + ret_conv_38_arr[m] = ret_conv_38_hu_conv; } - return ret_conv_14_arr; + return ret_conv_38_arr; } } diff --git a/src/main/java/org/ldk/structs/WatchedOutput.java b/src/main/java/org/ldk/structs/WatchedOutput.java index 2f79d23a..0b039935 100644 --- a/src/main/java/org/ldk/structs/WatchedOutput.java +++ b/src/main/java/org/ldk/structs/WatchedOutput.java @@ -60,7 +60,7 @@ public class WatchedOutput extends CommonBase { long ret = bindings.WatchedOutput_get_outpoint(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -101,7 +101,7 @@ public class WatchedOutput extends CommonBase { Reference.reachabilityFence(outpoint_arg); Reference.reachabilityFence(script_pubkey_arg); if (ret >= 0 && ret <= 4096) { return null; } - WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new WatchedOutput(null, ret); } + org.ldk.structs.WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WatchedOutput(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -119,7 +119,7 @@ public class WatchedOutput extends CommonBase { long ret = bindings.WatchedOutput_clone(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new WatchedOutput(null, ret); } + org.ldk.structs.WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WatchedOutput(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index ff170b1b..64af707e 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -681,10 +681,12 @@ static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass case 2: return LDKSecp256k1Error_InvalidPublicKey; case 3: return LDKSecp256k1Error_InvalidSignature; case 4: return LDKSecp256k1Error_InvalidSecretKey; - case 5: return LDKSecp256k1Error_InvalidRecoveryId; - case 6: return LDKSecp256k1Error_InvalidTweak; - case 7: return LDKSecp256k1Error_TweakCheckFailed; + case 5: return LDKSecp256k1Error_InvalidSharedSecret; + case 6: return LDKSecp256k1Error_InvalidRecoveryId; + case 7: return LDKSecp256k1Error_InvalidTweak; case 8: return LDKSecp256k1Error_NotEnoughMemory; + case 9: return LDKSecp256k1Error_InvalidPublicKeySum; + case 10: return LDKSecp256k1Error_InvalidParityValue; } (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -695,10 +697,12 @@ static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidMessage = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSignature = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL; +static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL; -static jfieldID Secp256k1Error_LDKSecp256k1Error_TweakCheckFailed = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL; +static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = NULL; +static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jclass clz) { Secp256k1Error_class = (*env)->NewGlobalRef(env, clz); CHECK(Secp256k1Error_class != NULL); @@ -712,14 +716,18 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jcla CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSignature != NULL); Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey != NULL); + Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSharedSecret", "Lorg/ldk/enums/Secp256k1Error;"); + CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret != NULL); Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL); Secp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL); - Secp256k1Error_LDKSecp256k1Error_TweakCheckFailed = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_TweakCheckFailed", "Lorg/ldk/enums/Secp256k1Error;"); - CHECK(Secp256k1Error_LDKSecp256k1Error_TweakCheckFailed != NULL); Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL); + Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKeySum", "Lorg/ldk/enums/Secp256k1Error;"); + CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum != NULL); + Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidParityValue", "Lorg/ldk/enums/Secp256k1Error;"); + CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidParityValue != NULL); } static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) { switch (val) { @@ -733,14 +741,18 @@ static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error va return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSignature); case LDKSecp256k1Error_InvalidSecretKey: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey); + case LDKSecp256k1Error_InvalidSharedSecret: + return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret); case LDKSecp256k1Error_InvalidRecoveryId: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId); case LDKSecp256k1Error_InvalidTweak: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidTweak); - case LDKSecp256k1Error_TweakCheckFailed: - return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_TweakCheckFailed); case LDKSecp256k1Error_NotEnoughMemory: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory); + case LDKSecp256k1Error_InvalidPublicKeySum: + return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum); + case LDKSecp256k1Error_InvalidParityValue: + return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidParityValue); default: abort(); } } @@ -1897,191 +1909,70 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return ret_ref; } -static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return TxOut_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv); - return (int64_t)ret_ref; -} - -static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return AccessError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); - jclass ret_conv = LDKAccessError_to_java(env, CResult_TxOutAccessErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ - return owner->a; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); - int64_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv); - return ret_conv; -} - -static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ - return owner->b; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); - LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { - LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]); - } - return ret; -} -static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) { - LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ 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 inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(owner & ~1); - CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv); -} - -static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return ChannelMonitorUpdateErr_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(owner & ~1); - jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv)); - return ret_conv; -} - -static jclass LDKMonitorEvent_HTLCEvent_class = NULL; -static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL; -static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL; -static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL; -static jclass LDKMonitorEvent_UpdateCompleted_class = NULL; -static jmethodID LDKMonitorEvent_UpdateCompleted_meth = NULL; -static jclass LDKMonitorEvent_UpdateFailed_class = NULL; -static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) { - LDKMonitorEvent_HTLCEvent_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent")); - CHECK(LDKMonitorEvent_HTLCEvent_class != NULL); - LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "", "(J)V"); - CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL); - LDKMonitorEvent_CommitmentTxConfirmed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed")); - CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL); - LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "", "(J)V"); - CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL); - LDKMonitorEvent_UpdateCompleted_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted")); - CHECK(LDKMonitorEvent_UpdateCompleted_class != NULL); - LDKMonitorEvent_UpdateCompleted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateCompleted_class, "", "(JJ)V"); - CHECK(LDKMonitorEvent_UpdateCompleted_meth != NULL); - LDKMonitorEvent_UpdateFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed")); - CHECK(LDKMonitorEvent_UpdateFailed_class != NULL); - LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "", "(J)V"); - CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL); +static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; +static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; +static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; +static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { + LDKPaymentPurpose_InvoicePayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment")); + CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); + LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[B)V"); + CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); + LDKPaymentPurpose_SpontaneousPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment")); + CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); + LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); + CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); switch(obj->tag) { - case LDKMonitorEvent_HTLCEvent: { - LDKHTLCUpdate htlc_event_var = obj->htlc_event; - int64_t htlc_event_ref = 0; - CHECK((((uintptr_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); - htlc_event_ref = (uintptr_t)htlc_event_var.inner & ~1; - return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref); - } - case LDKMonitorEvent_CommitmentTxConfirmed: { - LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed; - int64_t commitment_tx_confirmed_ref = 0; - CHECK((((uintptr_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); - commitment_tx_confirmed_ref = (uintptr_t)commitment_tx_confirmed_var.inner & ~1; - return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref); - } - case LDKMonitorEvent_UpdateCompleted: { - LDKOutPoint funding_txo_var = obj->update_completed.funding_txo; - int64_t funding_txo_ref = 0; - CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); - funding_txo_ref = (uintptr_t)funding_txo_var.inner & ~1; - int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id; - return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, monitor_update_id_conv); + case LDKPaymentPurpose_InvoicePayment: { + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); + int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); + return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr); } - case LDKMonitorEvent_UpdateFailed: { - LDKOutPoint update_failed_var = obj->update_failed; - int64_t update_failed_ref = 0; - CHECK((((uintptr_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); - update_failed_ref = (uintptr_t)update_failed_var.inner & ~1; - return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref); + case LDKPaymentPurpose_SpontaneousPayment: { + int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); + return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); } default: abort(); } } -static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { - LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = MonitorEvent_clone(&orig->data[i]); - } - return ret; +static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return PaymentPurpose_clone(&*owner->contents.result); } -static jclass LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = NULL; -static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = NULL; -static jclass LDKCOption_C2Tuple_usizeTransactionZZ_None_class = NULL; -static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1usizeTransactionZZ_init (JNIEnv *env, jclass clz) { - LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some")); - CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_class != NULL); - LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth != NULL); - LDKCOption_C2Tuple_usizeTransactionZZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None")); - CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_class != NULL); - LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, "", "()V"); - CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_meth != NULL); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(owner & ~1); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeTransactionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)(ptr & ~1); - switch(obj->tag) { - case LDKCOption_C2Tuple_usizeTransactionZZ_Some: { - LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *some_conv = obj->some; - *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv); - return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth, ((int64_t)some_conv)); - } - case LDKCOption_C2Tuple_usizeTransactionZZ_None: { - return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, LDKCOption_C2Tuple_usizeTransactionZZ_None_meth); - } - default: abort(); + +static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } + return ret_ref; } + static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL; static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL; static jclass LDKClosureReason_HolderForceClosed_class = NULL; @@ -2235,8 +2126,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureRe static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL; static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL; -static jclass LDKNetworkUpdate_ChannelClosed_class = NULL; -static jmethodID LDKNetworkUpdate_ChannelClosed_meth = NULL; +static jclass LDKNetworkUpdate_ChannelFailure_class = NULL; +static jmethodID LDKNetworkUpdate_ChannelFailure_meth = NULL; static jclass LDKNetworkUpdate_NodeFailure_class = NULL; static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) { @@ -2245,11 +2136,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JN CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL); LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "", "(J)V"); CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL); - LDKNetworkUpdate_ChannelClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelClosed")); - CHECK(LDKNetworkUpdate_ChannelClosed_class != NULL); - LDKNetworkUpdate_ChannelClosed_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelClosed_class, "", "(JZ)V"); - CHECK(LDKNetworkUpdate_ChannelClosed_meth != NULL); + LDKNetworkUpdate_ChannelFailure_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelFailure")); + CHECK(LDKNetworkUpdate_ChannelFailure_class != NULL); + LDKNetworkUpdate_ChannelFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelFailure_class, "", "(JZ)V"); + CHECK(LDKNetworkUpdate_ChannelFailure_meth != NULL); LDKNetworkUpdate_NodeFailure_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure")); CHECK(LDKNetworkUpdate_NodeFailure_class != NULL); @@ -2268,10 +2159,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from msg_ref = (uintptr_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref); } - case LDKNetworkUpdate_ChannelClosed: { - int64_t short_channel_id_conv = obj->channel_closed.short_channel_id; - jboolean is_permanent_conv = obj->channel_closed.is_permanent; - return (*env)->NewObject(env, LDKNetworkUpdate_ChannelClosed_class, LDKNetworkUpdate_ChannelClosed_meth, short_channel_id_conv, is_permanent_conv); + case LDKNetworkUpdate_ChannelFailure: { + int64_t short_channel_id_conv = obj->channel_failure.short_channel_id; + jboolean is_permanent_conv = obj->channel_failure.is_permanent; + return (*env)->NewObject(env, LDKNetworkUpdate_ChannelFailure_class, LDKNetworkUpdate_ChannelFailure_meth, short_channel_id_conv, is_permanent_conv); } case LDKNetworkUpdate_NodeFailure: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -2375,50 +2266,20 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ } return ret; } -static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; -static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; -static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; -static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { - LDKPaymentPurpose_InvoicePayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment")); - CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); - LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[B)V"); - CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); - LDKPaymentPurpose_SpontaneousPayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment")); - CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); - LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); - CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); - switch(obj->tag) { - case LDKPaymentPurpose_InvoicePayment: { - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); - int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); - return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr); - } - case LDKPaymentPurpose_SpontaneousPayment: { - int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); - return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); - } - default: abort(); - } -} static jclass LDKEvent_FundingGenerationReady_class = NULL; static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; static jclass LDKEvent_PaymentReceived_class = NULL; static jmethodID LDKEvent_PaymentReceived_meth = NULL; +static jclass LDKEvent_PaymentClaimed_class = NULL; +static jmethodID LDKEvent_PaymentClaimed_meth = NULL; static jclass LDKEvent_PaymentSent_class = NULL; static jmethodID LDKEvent_PaymentSent_meth = NULL; -static jclass LDKEvent_PaymentPathFailed_class = NULL; -static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; static jclass LDKEvent_PaymentFailed_class = NULL; static jmethodID LDKEvent_PaymentFailed_meth = NULL; +static jclass LDKEvent_PaymentPathSuccessful_class = NULL; +static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL; +static jclass LDKEvent_PaymentPathFailed_class = NULL; +static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; static jclass LDKEvent_SpendableOutputs_class = NULL; @@ -2429,36 +2290,44 @@ static jclass LDKEvent_ChannelClosed_class = NULL; static jmethodID LDKEvent_ChannelClosed_meth = NULL; static jclass LDKEvent_DiscardFunding_class = NULL; static jmethodID LDKEvent_DiscardFunding_meth = NULL; -static jclass LDKEvent_PaymentPathSuccessful_class = NULL; -static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL; static jclass LDKEvent_OpenChannelRequest_class = NULL; static jmethodID LDKEvent_OpenChannelRequest_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { LDKEvent_FundingGenerationReady_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady")); CHECK(LDKEvent_FundingGenerationReady_class != NULL); - LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); + LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([B[BJ[BJ)V"); CHECK(LDKEvent_FundingGenerationReady_meth != NULL); LDKEvent_PaymentReceived_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentReceived")); CHECK(LDKEvent_PaymentReceived_class != NULL); LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([BJJ)V"); CHECK(LDKEvent_PaymentReceived_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, "", "([BJJ)V"); + CHECK(LDKEvent_PaymentClaimed_meth != NULL); LDKEvent_PaymentSent_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent")); CHECK(LDKEvent_PaymentSent_class != NULL); LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B[B[BJ)V"); CHECK(LDKEvent_PaymentSent_meth != NULL); - LDKEvent_PaymentPathFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed")); - CHECK(LDKEvent_PaymentPathFailed_class != NULL); - LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); - CHECK(LDKEvent_PaymentPathFailed_meth != NULL); LDKEvent_PaymentFailed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed")); CHECK(LDKEvent_PaymentFailed_class != NULL); LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "", "([B[B)V"); CHECK(LDKEvent_PaymentFailed_meth != NULL); + LDKEvent_PaymentPathSuccessful_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful")); + CHECK(LDKEvent_PaymentPathSuccessful_class != NULL); + LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "", "([B[B[J)V"); + CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL); + LDKEvent_PaymentPathFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed")); + CHECK(LDKEvent_PaymentPathFailed_class != NULL); + LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); + CHECK(LDKEvent_PaymentPathFailed_meth != NULL); LDKEvent_PendingHTLCsForwardable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable")); CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); @@ -2472,7 +2341,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, "", "(JZ)V"); + LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "([B[BJZ)V"); CHECK(LDKEvent_PaymentForwarded_meth != NULL); LDKEvent_ChannelClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed")); @@ -2484,11 +2353,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en CHECK(LDKEvent_DiscardFunding_class != NULL); LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "([B[B)V"); CHECK(LDKEvent_DiscardFunding_meth != NULL); - LDKEvent_PaymentPathSuccessful_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful")); - CHECK(LDKEvent_PaymentPathSuccessful_class != NULL); - LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "", "([B[B[J)V"); - CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL); LDKEvent_OpenChannelRequest_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OpenChannelRequest")); CHECK(LDKEvent_OpenChannelRequest_class != NULL); @@ -2501,19 +2365,28 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN case LDKEvent_FundingGenerationReady: { int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data); + int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->funding_generation_ready.counterparty_node_id.compressed_form); int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis; LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen); (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data); int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id; - return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_conv); + return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, counterparty_node_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_conv); } case LDKEvent_PaymentReceived: { int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data); - int64_t amt_conv = obj->payment_received.amt; + int64_t amount_msat_conv = obj->payment_received.amount_msat; int64_t purpose_ref = ((uintptr_t)&obj->payment_received.purpose) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, amt_conv, purpose_ref); + return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, amount_msat_conv, purpose_ref); + } + case LDKEvent_PaymentClaimed: { + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimed.payment_hash.data); + int64_t amount_msat_conv = obj->payment_claimed.amount_msat; + int64_t purpose_ref = ((uintptr_t)&obj->payment_claimed.purpose) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, payment_hash_arr, amount_msat_conv, purpose_ref); } case LDKEvent_PaymentSent: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); @@ -2525,6 +2398,34 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t fee_paid_msat_ref = ((uintptr_t)&obj->payment_sent.fee_paid_msat) | 1; return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref); } + case LDKEvent_PaymentFailed: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data); + return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr); + } + case LDKEvent_PaymentPathSuccessful: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data); + LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path; + int64_tArray path_arr = NULL; + path_arr = (*env)->NewLongArray(env, path_var.datalen); + int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + int64_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner & ~1; + path_arr_ptr[k] = path_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); + return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr); + } case LDKEvent_PaymentPathFailed: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data); @@ -2558,13 +2459,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN } return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, rejected_by_dest_conv, network_update_ref, all_paths_failed_conv, path_arr, short_channel_id_ref, retry_ref); } - case LDKEvent_PaymentFailed: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data); - return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr); - } case LDKEvent_PendingHTLCsForwardable: { int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable; return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, time_forwardable_conv); @@ -2582,9 +2476,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr); } case LDKEvent_PaymentForwarded: { + int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->payment_forwarded.prev_channel_id.data); + int8_tArray next_channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, next_channel_id_arr, 0, 32, obj->payment_forwarded.next_channel_id.data); int64_t fee_earned_msat_ref = ((uintptr_t)&obj->payment_forwarded.fee_earned_msat) | 1; jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx; - return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, claim_from_onchain_tx_conv); + return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, prev_channel_id_arr, next_channel_id_arr, fee_earned_msat_ref, claim_from_onchain_tx_conv); } case LDKEvent_ChannelClosed: { int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); @@ -2601,27 +2499,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr); } - case LDKEvent_PaymentPathSuccessful: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data); - LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path; - int64_tArray path_arr = NULL; - path_arr = (*env)->NewLongArray(env, path_var.datalen); - int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - int64_t path_conv_10_ref = 0; - CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uintptr_t)path_conv_10_var.inner & ~1; - path_arr_ptr[k] = path_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); - return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr); - } case LDKEvent_OpenChannelRequest: { int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->open_channel_request.temporary_channel_id.data); @@ -2797,8 +2674,8 @@ static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL; static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL; static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL; static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL; -static jclass LDKMessageSendEvent_SendFundingLocked_class = NULL; -static jmethodID LDKMessageSendEvent_SendFundingLocked_meth = NULL; +static jclass LDKMessageSendEvent_SendChannelReady_class = NULL; +static jmethodID LDKMessageSendEvent_SendChannelReady_meth = NULL; static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL; static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL; static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL; @@ -2850,11 +2727,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL); LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "", "([BJ)V"); CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL); - LDKMessageSendEvent_SendFundingLocked_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked")); - CHECK(LDKMessageSendEvent_SendFundingLocked_class != NULL); - LDKMessageSendEvent_SendFundingLocked_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingLocked_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendFundingLocked_meth != NULL); + LDKMessageSendEvent_SendChannelReady_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReady")); + CHECK(LDKMessageSendEvent_SendChannelReady_class != NULL); + LDKMessageSendEvent_SendChannelReady_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReady_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendChannelReady_meth != NULL); LDKMessageSendEvent_SendAnnouncementSignatures_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures")); CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL); @@ -2978,16 +2855,16 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f msg_ref = (uintptr_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref); } - case LDKMessageSendEvent_SendFundingLocked: { + case LDKMessageSendEvent_SendChannelReady: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_locked.node_id.compressed_form); - LDKFundingLocked msg_var = obj->send_funding_locked.msg; + (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_ready.node_id.compressed_form); + LDKChannelReady msg_var = obj->send_channel_ready.msg; int64_t msg_ref = 0; CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uintptr_t)msg_var.inner & ~1; - return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref); + return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReady_class, LDKMessageSendEvent_SendChannelReady_meth, node_id_arr, msg_ref); } case LDKMessageSendEvent_SendAnnouncementSignatures: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -3159,31 +3036,166 @@ static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCV } return ret; } -static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return FixedPenaltyScorer_clone(&*owner->contents.result); + return TxOut_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(owner & ~1); - LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv); + return (int64_t)ret_ref; +} + +static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return AccessError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); + jclass ret_conv = LDKAccessError_to_java(env, CResult_TxOutAccessErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); + int64_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv); + return ret_conv; +} + +static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); + LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { + LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]); } - return ret_ref; + return ret; +} +static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) { + LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ 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 inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(owner & ~1); + CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv); } -static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ +static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return ChannelMonitorUpdateErr_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(owner & ~1); + jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv)); + return ret_conv; +} + +static jclass LDKMonitorEvent_HTLCEvent_class = NULL; +static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL; +static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL; +static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL; +static jclass LDKMonitorEvent_UpdateCompleted_class = NULL; +static jmethodID LDKMonitorEvent_UpdateCompleted_meth = NULL; +static jclass LDKMonitorEvent_UpdateFailed_class = NULL; +static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) { + LDKMonitorEvent_HTLCEvent_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent")); + CHECK(LDKMonitorEvent_HTLCEvent_class != NULL); + LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "", "(J)V"); + CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL); + LDKMonitorEvent_CommitmentTxConfirmed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed")); + CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL); + LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "", "(J)V"); + CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL); + LDKMonitorEvent_UpdateCompleted_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted")); + CHECK(LDKMonitorEvent_UpdateCompleted_class != NULL); + LDKMonitorEvent_UpdateCompleted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateCompleted_class, "", "(JJ)V"); + CHECK(LDKMonitorEvent_UpdateCompleted_meth != NULL); + LDKMonitorEvent_UpdateFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed")); + CHECK(LDKMonitorEvent_UpdateFailed_class != NULL); + LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "", "(J)V"); + CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); + switch(obj->tag) { + case LDKMonitorEvent_HTLCEvent: { + LDKHTLCUpdate htlc_event_var = obj->htlc_event; + int64_t htlc_event_ref = 0; + CHECK((((uintptr_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); + htlc_event_ref = (uintptr_t)htlc_event_var.inner & ~1; + return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref); + } + case LDKMonitorEvent_CommitmentTxConfirmed: { + LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed; + int64_t commitment_tx_confirmed_ref = 0; + CHECK((((uintptr_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); + commitment_tx_confirmed_ref = (uintptr_t)commitment_tx_confirmed_var.inner & ~1; + return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref); + } + case LDKMonitorEvent_UpdateCompleted: { + LDKOutPoint funding_txo_var = obj->update_completed.funding_txo; + int64_t funding_txo_ref = 0; + CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); + funding_txo_ref = (uintptr_t)funding_txo_var.inner & ~1; + int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id; + return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, monitor_update_id_conv); + } + case LDKMonitorEvent_UpdateFailed: { + LDKOutPoint update_failed_var = obj->update_failed; + int64_t update_failed_ref = 0; + CHECK((((uintptr_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); + update_failed_ref = (uintptr_t)update_failed_var.inner & ~1; + return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref); + } + default: abort(); + } +} +static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { + LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MonitorEvent_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorEventZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR owner){ + return OutPoint_clone(&owner->a); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(owner & ~1); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorEventZZ_get_a(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3195,13 +3207,71 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorer return ret_ref; } -static inline struct LDKScoringParameters CResult_ScoringParametersDecodeErrorZ_get_ok(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKCVec_MonitorEventZ C2Tuple_OutPointCVec_MonitorEventZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR owner){ + return CVec_MonitorEventZ_clone(&owner->b); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(owner & ~1); + LDKCVec_MonitorEventZ ret_var = C2Tuple_OutPointCVec_MonitorEventZZ_get_b(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t o = 0; o < ret_var.datalen; o++) { + LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_conv_14_copy = ret_var.data[o]; + int64_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; + ret_arr_ptr[o] = ret_conv_14_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointCVec_MonitorEventZZ_clone(&orig->data[i]); + } + return ret; +} +static jclass LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_usizeTransactionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1usizeTransactionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some")); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_class != NULL); + LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_usizeTransactionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None")); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_class != NULL); + LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeTransactionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_C2Tuple_usizeTransactionZZ_Some: { + LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth, ((int64_t)some_conv)); + } + case LDKCOption_C2Tuple_usizeTransactionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, LDKCOption_C2Tuple_usizeTransactionZZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ScoringParameters_clone(&*owner->contents.result); + return FixedPenaltyScorer_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ScoringParametersDecodeErrorZ* owner_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(owner & ~1); - LDKScoringParameters ret_var = CResult_ScoringParametersDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(owner & ~1); + LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3213,13 +3283,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD return ret_ref; } -static inline struct LDKDecodeError CResult_ScoringParametersDecodeErrorZ_get_err(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ScoringParametersDecodeErrorZ* owner_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_ScoringParametersDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3231,39 +3301,85 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD return ret_ref; } -static inline struct LDKScorer *CResult_ScorerDecodeErrorZ_get_ok(LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return &*owner->contents.result; +typedef struct LDKLogger_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID log_meth; +} LDKLogger_JCalls; +static void LDKLogger_JCalls_free(void* this_arg) { + LDKLogger_JCalls *j_calls = (LDKLogger_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); + } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ScorerDecodeErrorZ* owner_conv = (LDKCResult_ScorerDecodeErrorZ*)(owner & ~1); - LDKScorer ret_var = *CResult_ScorerDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner & ~1; - return ret_ref; +void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { + LDKLogger_JCalls *j_calls = (LDKLogger_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); + } + LDKRecord record_var = *record; + int64_t record_ref = 0; + record_var = Record_clone(&record_var); + CHECK((((uintptr_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); + record_ref = (uintptr_t)record_var.inner; + if (record_var.is_owned) { + record_ref |= 1; + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } +static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V"); + CHECK(calls->log_meth != NULL); -static inline struct LDKDecodeError CResult_ScorerDecodeErrorZ_get_err(LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + LDKLogger ret = { + .this_arg = (void*) calls, + .log = log_LDKLogger_jcall, + .free = LDKLogger_JCalls_free, + }; + return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ScorerDecodeErrorZ* owner_conv = (LDKCResult_ScorerDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_ScorerDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new(JNIEnv *env, jclass clz, jobject o) { + LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger"); + *res_ptr = LDKLogger_init(env, clz, o); + return (uint64_t)res_ptr; } - static inline struct LDKProbabilisticScorer *CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return &*owner->contents.result; @@ -3477,49 +3593,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeature return ret_ref; } -static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return DelayedPaymentOutputDescriptor_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return StaticPaymentOutputDescriptor_clone(&*owner->contents.result); + return NodeId_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); + LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3531,13 +3611,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu return ret_ref; } -static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3549,25 +3629,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu return ret_ref; } -static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return SpendableOutputDescriptor_clone(&*owner->contents.result); + return COption_NetworkUpdateZ_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); + LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); + *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3579,293 +3659,963 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDes return ret_ref; } -static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) { - LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]); +typedef struct LDKAccess_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID get_utxo_meth; +} LDKAccess_JCalls; +static void LDKAccess_JCalls_free(void* this_arg) { + LDKAccess_JCalls *j_calls = (LDKAccess_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); } - return ret; } -static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){ - return owner->a; +LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) { + LDKAccess_JCalls *j_calls = (LDKAccess_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 genesis_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash); + int64_t short_channel_id_conv = short_channel_id; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception."); + } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); + FREE((void*)ret); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form); - return ret_arr; +static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) { + LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } +static inline LDKAccess LDKAccess_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J"); + CHECK(calls->get_utxo_meth != NULL); -static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){ - return owner->b; -} -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); - LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - return ret_arr; + LDKAccess ret = { + .this_arg = (void*) calls, + .get_utxo = get_utxo_LDKAccess_jcall, + .free = LDKAccess_JCalls_free, + }; + return ret; } - -static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new(JNIEnv *env, jclass clz, jobject o) { + LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *res_ptr = LDKAccess_init(env, clz, o); + return (uint64_t)res_ptr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); - LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr; + unsigned char genesis_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, genesis_hash) == 32); + (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr); + unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr; + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id); + return (int64_t)ret_conv; } -static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +static jclass LDKCOption_AccessZ_Some_class = NULL; +static jmethodID LDKCOption_AccessZ_Some_meth = NULL; +static jclass LDKCOption_AccessZ_None_class = NULL; +static jmethodID LDKCOption_AccessZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AccessZ_init (JNIEnv *env, jclass clz) { + LDKCOption_AccessZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$Some")); + CHECK(LDKCOption_AccessZ_Some_class != NULL); + LDKCOption_AccessZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_AccessZ_Some_meth != NULL); + LDKCOption_AccessZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$None")); + CHECK(LDKCOption_AccessZ_None_class != NULL); + LDKCOption_AccessZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_None_class, "", "()V"); + CHECK(LDKCOption_AccessZ_None_meth != NULL); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_AccessZ_Some: { + LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *some_ret = obj->some; + // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances + if ((*some_ret).free == LDKAccess_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAccess_JCalls_cloned(&(*some_ret)); + } + return (*env)->NewObject(env, LDKCOption_AccessZ_Some_class, LDKCOption_AccessZ_Some_meth, (int64_t)some_ret); + } + case LDKCOption_AccessZ_None: { + return (*env)->NewObject(env, LDKCOption_AccessZ_None_class, LDKCOption_AccessZ_None_meth); + } + default: abort(); + } } - -static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){ +static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); + jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv); + return ret_conv; } -static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){ +static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return *owner->contents.err; + return LightningError_clone(&*owner->contents.err); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); - CResult_SignatureNoneZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); + LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){ - return owner->a; +static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ + return ChannelAnnouncement_clone(&owner->a); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); + LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){ - return owner->b; +static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ + return ChannelUpdate_clone(&owner->b); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); + LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result); +static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ + return ChannelUpdate_clone(&owner->c); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(owner & ~1); - LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); + LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) { + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(&orig->data[i]); + } + return ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(owner & ~1); - CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv); +static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) { + LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = NodeAnnouncement_clone(&orig->data[i]); + } + return ret; } - -static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){ +static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); + CResult_NoneLightningErrorZ_get_ok(owner_conv); } -static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){ +static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return *owner->contents.err; + return LightningError_clone(&*owner->contents.err); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)(owner & ~1); - CResult_SecretKeyNoneZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); + LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -typedef struct LDKBaseSign_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID get_per_commitment_point_meth; - jmethodID release_commitment_secret_meth; - jmethodID validate_holder_commitment_meth; - jmethodID channel_keys_id_meth; - jmethodID sign_counterparty_commitment_meth; - jmethodID validate_counterparty_revocation_meth; - jmethodID sign_holder_commitment_and_htlcs_meth; - jmethodID sign_justice_revoked_output_meth; - jmethodID sign_justice_revoked_htlc_meth; - jmethodID sign_counterparty_htlc_transaction_meth; - jmethodID sign_closing_transaction_meth; - jmethodID sign_channel_announcement_meth; - jmethodID ready_channel_meth; -} LDKBaseSign_JCalls; -static void LDKBaseSign_JCalls_free(void* this_arg) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); - } +static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ChannelUpdateInfo_clone(&*owner->contents.result); } -LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); - } - int64_t idx_conv = idx; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_per_commitment_point in LDKBaseSign from rust threw an exception."); - } - LDKPublicKey ret_ref; - CHECK((*env)->GetArrayLength(env, ret) == 33); - (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(owner & ~1); + LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); - } - int64_t idx_conv = idx; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to release_commitment_secret in LDKBaseSign 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); + +static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + +static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ChannelInfo_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); + LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - LDKHolderCommitmentTransaction holder_tx_var = *holder_tx; - int64_t holder_tx_ref = 0; - holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var); - CHECK((((uintptr_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); - holder_tx_ref = (uintptr_t)holder_tx_var.inner; - if (holder_tx_var.is_owned) { - holder_tx_ref |= 1; + return ret_ref; +} + +static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - LDKCVec_PaymentPreimageZ preimages_var = preimages; - jobjectArray preimages_arr = NULL; - preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < preimages_var.datalen; i++) { - int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data); - (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr); + return ret_ref; +} + +static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return RoutingFees_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); + LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - - FREE(preimages_var.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref, preimages_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception."); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - FREE((void*)ret); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + return ret_ref; +} + +static jclass LDKNetAddress_IPv4_class = NULL; +static jmethodID LDKNetAddress_IPv4_meth = NULL; +static jclass LDKNetAddress_IPv6_class = NULL; +static jmethodID LDKNetAddress_IPv6_meth = NULL; +static jclass LDKNetAddress_OnionV2_class = NULL; +static jmethodID LDKNetAddress_OnionV2_meth = NULL; +static jclass LDKNetAddress_OnionV3_class = NULL; +static jmethodID LDKNetAddress_OnionV3_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) { + LDKNetAddress_IPv4_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4")); + CHECK(LDKNetAddress_IPv4_class != NULL); + LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "", "([BS)V"); + CHECK(LDKNetAddress_IPv4_meth != NULL); + LDKNetAddress_IPv6_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6")); + CHECK(LDKNetAddress_IPv6_class != NULL); + LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "", "([BS)V"); + CHECK(LDKNetAddress_IPv6_meth != NULL); + LDKNetAddress_OnionV2_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2")); + CHECK(LDKNetAddress_OnionV2_class != NULL); + LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "", "([B)V"); + CHECK(LDKNetAddress_OnionV2_meth != NULL); + LDKNetAddress_OnionV3_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3")); + CHECK(LDKNetAddress_OnionV3_class != NULL); + LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "", "([BSBS)V"); + CHECK(LDKNetAddress_OnionV3_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); + switch(obj->tag) { + case LDKNetAddress_IPv4: { + int8_tArray addr_arr = (*env)->NewByteArray(env, 4); + (*env)->SetByteArrayRegion(env, addr_arr, 0, 4, obj->i_pv4.addr.data); + int16_t port_conv = obj->i_pv4.port; + return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, port_conv); + } + case LDKNetAddress_IPv6: { + int8_tArray addr_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, addr_arr, 0, 16, obj->i_pv6.addr.data); + int16_t port_conv = obj->i_pv6.port; + return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, port_conv); + } + case LDKNetAddress_OnionV2: { + int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12); + (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data); + return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr); + } + case LDKNetAddress_OnionV3: { + int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data); + int16_t checksum_conv = obj->onion_v3.checksum; + int8_t version_conv = obj->onion_v3.version; + int16_t port_conv = obj->onion_v3.port; + return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, checksum_conv, version_conv, port_conv); + } + default: abort(); } - return ret_conv; } -LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); +static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) { + LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = NetAddress_clone(&orig->data[i]); } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to channel_keys_id in LDKBaseSign from rust threw an exception."); + return ret; +} +static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return NodeAnnouncementInfo_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); + LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - 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; +} + +static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) { + LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen }; + memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen); + return ret; +} +static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return NodeInfo_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); + LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKNetworkGraph *CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return &*owner->contents.result; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); + LDKNetworkGraph ret_var = *CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner & ~1; + return ret_ref; +} + +static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL; +static jmethodID LDKCOption_CVec_NetAddressZZ_Some_meth = NULL; +static jclass LDKCOption_CVec_NetAddressZZ_None_class = NULL; +static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_CVec_NetAddressZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some")); + CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL); + LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "", "([J)V"); + CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL); + LDKCOption_CVec_NetAddressZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None")); + CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL); + LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "", "()V"); + CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_CVec_NetAddressZZ_Some: { + LDKCVec_NetAddressZ some_var = obj->some; + int64_tArray some_arr = NULL; + some_arr = (*env)->NewLongArray(env, some_var.datalen); + int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL); + for (size_t m = 0; m < some_var.datalen; m++) { + int64_t some_conv_12_ref = ((uintptr_t)&some_var.data[m]) | 1; + some_arr_ptr[m] = some_conv_12_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, some_arr, some_arr_ptr, 0); + return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_Some_class, LDKCOption_CVec_NetAddressZZ_Some_meth, some_arr); + } + case LDKCOption_CVec_NetAddressZZ_None: { + return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_None_class, LDKCOption_CVec_NetAddressZZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return DelayedPaymentOutputDescriptor_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return StaticPaymentOutputDescriptor_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return SpendableOutputDescriptor_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) { + LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ 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 inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form); + return ret_arr; +} + +static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); + LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + return ret_arr; +} + +static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv); + return ((int64_t)ret_conv); +} + +static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv); +} + +static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form); + return ret_arr; +} + +static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); + CResult_SignatureNoneZ_get_err(owner_conv); +} + +static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form); + return ret_arr; +} + +static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form); + return ret_arr; +} + +static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(owner & ~1); + LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv); + return ((int64_t)ret_conv); +} + +static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(owner & ~1); + CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv); +} + +static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes); + return ret_arr; +} + +static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)(owner & ~1); + CResult_SecretKeyNoneZ_get_err(owner_conv); +} + +typedef struct LDKBaseSign_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID get_per_commitment_point_meth; + jmethodID release_commitment_secret_meth; + jmethodID validate_holder_commitment_meth; + jmethodID channel_keys_id_meth; + jmethodID sign_counterparty_commitment_meth; + jmethodID validate_counterparty_revocation_meth; + jmethodID sign_holder_commitment_and_htlcs_meth; + jmethodID sign_justice_revoked_output_meth; + jmethodID sign_justice_revoked_htlc_meth; + jmethodID sign_counterparty_htlc_transaction_meth; + jmethodID sign_closing_transaction_meth; + jmethodID sign_channel_announcement_meth; + jmethodID ready_channel_meth; +} LDKBaseSign_JCalls; +static void LDKBaseSign_JCalls_free(void* this_arg) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + } +} +LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + } + int64_t idx_conv = idx; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to get_per_commitment_point in LDKBaseSign from rust threw an exception."); + } + LDKPublicKey ret_ref; + CHECK((*env)->GetArrayLength(env, ret) == 33); + (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_ref; +} +LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + } + int64_t idx_conv = idx; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to release_commitment_secret in LDKBaseSign 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 validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + } + LDKHolderCommitmentTransaction holder_tx_var = *holder_tx; + int64_t holder_tx_ref = 0; + holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var); + CHECK((((uintptr_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); + holder_tx_ref = (uintptr_t)holder_tx_var.inner; + if (holder_tx_var.is_owned) { + holder_tx_ref |= 1; + } + LDKCVec_PaymentPreimageZ preimages_var = preimages; + jobjectArray preimages_arr = NULL; + preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < preimages_var.datalen; i++) { + int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data); + (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr); + } + + FREE(preimages_var.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref, preimages_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception."); + } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE((void*)ret); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to channel_keys_id in LDKBaseSign 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; } @@ -5149,74 +5899,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHa return ret_ref; } -static jclass LDKNetAddress_IPv4_class = NULL; -static jmethodID LDKNetAddress_IPv4_meth = NULL; -static jclass LDKNetAddress_IPv6_class = NULL; -static jmethodID LDKNetAddress_IPv6_meth = NULL; -static jclass LDKNetAddress_OnionV2_class = NULL; -static jmethodID LDKNetAddress_OnionV2_meth = NULL; -static jclass LDKNetAddress_OnionV3_class = NULL; -static jmethodID LDKNetAddress_OnionV3_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) { - LDKNetAddress_IPv4_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4")); - CHECK(LDKNetAddress_IPv4_class != NULL); - LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "", "([BS)V"); - CHECK(LDKNetAddress_IPv4_meth != NULL); - LDKNetAddress_IPv6_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6")); - CHECK(LDKNetAddress_IPv6_class != NULL); - LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "", "([BS)V"); - CHECK(LDKNetAddress_IPv6_meth != NULL); - LDKNetAddress_OnionV2_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2")); - CHECK(LDKNetAddress_OnionV2_class != NULL); - LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "", "([B)V"); - CHECK(LDKNetAddress_OnionV2_meth != NULL); - LDKNetAddress_OnionV3_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3")); - CHECK(LDKNetAddress_OnionV3_class != NULL); - LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "", "([BSBS)V"); - CHECK(LDKNetAddress_OnionV3_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); - switch(obj->tag) { - case LDKNetAddress_IPv4: { - int8_tArray addr_arr = (*env)->NewByteArray(env, 4); - (*env)->SetByteArrayRegion(env, addr_arr, 0, 4, obj->i_pv4.addr.data); - int16_t port_conv = obj->i_pv4.port; - return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, port_conv); - } - case LDKNetAddress_IPv6: { - int8_tArray addr_arr = (*env)->NewByteArray(env, 16); - (*env)->SetByteArrayRegion(env, addr_arr, 0, 16, obj->i_pv6.addr.data); - int16_t port_conv = obj->i_pv6.port; - return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, port_conv); - } - case LDKNetAddress_OnionV2: { - int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12); - (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data); - return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr); - } - case LDKNetAddress_OnionV3: { - int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data); - int16_t checksum_conv = obj->onion_v3.checksum; - int8_t version_conv = obj->onion_v3.version; - int16_t port_conv = obj->onion_v3.port; - return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, checksum_conv, version_conv, port_conv); - } - default: abort(); - } -} -static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) { - LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = NetAddress_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -5608,7 +6290,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void } return ret_conv; } -LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -5624,20 +6306,20 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to release_pending_monitor_events in LDKWatch from rust threw an exception."); } - LDKCVec_MonitorEventZ ret_constr; + LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t o = 0; o < ret_constr.datalen; o++) { - int64_t ret_conv_14 = ret_vals[o]; - void* ret_conv_14_ptr = (void*)(((uintptr_t)ret_conv_14) & ~1); - CHECK_ACCESS(ret_conv_14_ptr); - LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr); - FREE((void*)ret_conv_14); - ret_constr.data[o] = ret_conv_14_conv; + for (size_t m = 0; m < ret_constr.datalen; m++) { + int64_t ret_conv_38 = ret_vals[m]; + void* ret_conv_38_ptr = (void*)(((uintptr_t)ret_conv_38) & ~1); + CHECK_ACCESS(ret_conv_38_ptr); + LDKC2Tuple_OutPointCVec_MonitorEventZZ ret_conv_38_conv = *(LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(ret_conv_38_ptr); + FREE((void*)ret_conv_38); + ret_constr.data[m] = ret_conv_38_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); if (get_jenv_res == JNI_EDETACHED) { @@ -5719,15 +6401,14 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pendin void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; - LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_conv_14_copy = ret_var.data[o]; - int64_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; - ret_arr_ptr[o] = ret_conv_14_ref; + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv_38_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ"); + *ret_conv_38_conv = ret_var.data[m]; + ret_arr_ptr[m] = ((int64_t)ret_conv_38_conv); } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); @@ -6298,85 +6979,6 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat return ret_conv; } -typedef struct LDKLogger_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID log_meth; -} LDKLogger_JCalls; -static void LDKLogger_JCalls_free(void* this_arg) { - LDKLogger_JCalls *j_calls = (LDKLogger_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); - } -} -void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { - LDKLogger_JCalls *j_calls = (LDKLogger_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); - } - LDKRecord record_var = *record; - int64_t record_ref = 0; - record_var = Record_clone(&record_var); - CHECK((((uintptr_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); - record_ref = (uintptr_t)record_var.inner; - if (record_var.is_owned) { - record_ref |= 1; - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { - LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V"); - CHECK(calls->log_meth != NULL); - - LDKLogger ret = { - .this_arg = (void*) calls, - .log = log_LDKLogger_jcall, - .free = LDKLogger_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new(JNIEnv *env, jclass clz, jobject o) { - LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger"); - *res_ptr = LDKLogger_init(env, clz, o); - return (uint64_t)res_ptr; -} static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -7707,33 +8309,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash return ret_ref; } -static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); - CResult_NoneLightningErrorZ_get_ok(owner_conv); -} - -static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return LightningError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); - LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){ return owner->a; } @@ -7761,99 +8336,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); - jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv); - return ret_conv; -} - -static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return LightningError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); - LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ - return ChannelAnnouncement_clone(&owner->a); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); - LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ - return ChannelUpdate_clone(&owner->b); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); - LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ - return ChannelUpdate_clone(&owner->c); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); - LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(&orig->data[i]); - } - return ret; -} -static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) { - LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = NodeAnnouncement_clone(&orig->data[i]); - } - return ret; -} static jclass LDKCOption_NetAddressZ_Some_class = NULL; static jmethodID LDKCOption_NetAddressZ_Some_meth = NULL; static jclass LDKCOption_NetAddressZ_None_class = NULL; @@ -7969,455 +8451,68 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErro return ret_ref; } -static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return NodeId_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); - LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); +static jclass LDKGraphSyncError_DecodeError_class = NULL; +static jmethodID LDKGraphSyncError_DecodeError_meth = NULL; +static jclass LDKGraphSyncError_LightningError_class = NULL; +static jmethodID LDKGraphSyncError_LightningError_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGraphSyncError_init (JNIEnv *env, jclass clz) { + LDKGraphSyncError_DecodeError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$DecodeError")); + CHECK(LDKGraphSyncError_DecodeError_class != NULL); + LDKGraphSyncError_DecodeError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_DecodeError_class, "", "(J)V"); + CHECK(LDKGraphSyncError_DecodeError_meth != NULL); + LDKGraphSyncError_LightningError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$LightningError")); + CHECK(LDKGraphSyncError_LightningError_class != NULL); + LDKGraphSyncError_LightningError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_LightningError_class, "", "(J)V"); + CHECK(LDKGraphSyncError_LightningError_meth != NULL); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return COption_NetworkUpdateZ_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); - LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); - *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -typedef struct LDKAccess_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID get_utxo_meth; -} LDKAccess_JCalls; -static void LDKAccess_JCalls_free(void* this_arg) { - LDKAccess_JCalls *j_calls = (LDKAccess_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_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) { - LDKAccess_JCalls *j_calls = (LDKAccess_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 genesis_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash); - int64_t short_channel_id_conv = short_channel_id; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception."); - } - void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); - CHECK_ACCESS(ret_ptr); - LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); - FREE((void*)ret); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) { - LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKAccess LDKAccess_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J"); - CHECK(calls->get_utxo_meth != NULL); - - LDKAccess ret = { - .this_arg = (void*) calls, - .get_utxo = get_utxo_LDKAccess_jcall, - .free = LDKAccess_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new(JNIEnv *env, jclass clz, jobject o) { - LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); - *res_ptr = LDKAccess_init(env, clz, o); - return (uint64_t)res_ptr; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr; - unsigned char genesis_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, genesis_hash) == 32); - (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr); - unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr; - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id); - return (int64_t)ret_conv; -} - -static jclass LDKCOption_AccessZ_Some_class = NULL; -static jmethodID LDKCOption_AccessZ_Some_meth = NULL; -static jclass LDKCOption_AccessZ_None_class = NULL; -static jmethodID LDKCOption_AccessZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AccessZ_init (JNIEnv *env, jclass clz) { - LDKCOption_AccessZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$Some")); - CHECK(LDKCOption_AccessZ_Some_class != NULL); - LDKCOption_AccessZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_AccessZ_Some_meth != NULL); - LDKCOption_AccessZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$None")); - CHECK(LDKCOption_AccessZ_None_class != NULL); - LDKCOption_AccessZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_None_class, "", "()V"); - CHECK(LDKCOption_AccessZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)(ptr & ~1); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKGraphSyncError *obj = (LDKGraphSyncError*)(ptr & ~1); switch(obj->tag) { - case LDKCOption_AccessZ_Some: { - LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess"); - *some_ret = obj->some; - // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances - if ((*some_ret).free == LDKAccess_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKAccess_JCalls_cloned(&(*some_ret)); - } - return (*env)->NewObject(env, LDKCOption_AccessZ_Some_class, LDKCOption_AccessZ_Some_meth, (int64_t)some_ret); + case LDKGraphSyncError_DecodeError: { + LDKDecodeError decode_error_var = obj->decode_error; + int64_t decode_error_ref = 0; + CHECK((((uintptr_t)decode_error_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&decode_error_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(decode_error_var); + decode_error_ref = (uintptr_t)decode_error_var.inner & ~1; + return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref); } - case LDKCOption_AccessZ_None: { - return (*env)->NewObject(env, LDKCOption_AccessZ_None_class, LDKCOption_AccessZ_None_meth); + case LDKGraphSyncError_LightningError: { + LDKLightningError lightning_error_var = obj->lightning_error; + int64_t lightning_error_ref = 0; + CHECK((((uintptr_t)lightning_error_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&lightning_error_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var); + lightning_error_ref = (uintptr_t)lightning_error_var.inner & ~1; + return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref); } default: abort(); } } -static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){ +static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ChannelUpdateInfo_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(owner & ~1); - LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return ChannelInfo_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); - LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return RoutingFees_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); - LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return NodeAnnouncementInfo_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); - LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) { - LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen }; - memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen); - return ret; -} -static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return NodeInfo_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); - LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return NetworkGraph_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); - LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)(owner & ~1); + int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv); + return ret_conv; } -static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return GraphSyncError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)(owner & ~1); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL; -static jmethodID LDKCOption_CVec_NetAddressZZ_Some_meth = NULL; -static jclass LDKCOption_CVec_NetAddressZZ_None_class = NULL; -static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) { - LDKCOption_CVec_NetAddressZZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some")); - CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL); - LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "", "([J)V"); - CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL); - LDKCOption_CVec_NetAddressZZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None")); - CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL); - LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "", "()V"); - CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)(ptr & ~1); - switch(obj->tag) { - case LDKCOption_CVec_NetAddressZZ_Some: { - LDKCVec_NetAddressZ some_var = obj->some; - int64_tArray some_arr = NULL; - some_arr = (*env)->NewLongArray(env, some_var.datalen); - int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL); - for (size_t m = 0; m < some_var.datalen; m++) { - int64_t some_conv_12_ref = ((uintptr_t)&some_var.data[m]) | 1; - some_arr_ptr[m] = some_conv_12_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, some_arr, some_arr_ptr, 0); - return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_Some_class, LDKCOption_CVec_NetAddressZZ_Some_meth, some_arr); - } - case LDKCOption_CVec_NetAddressZZ_None: { - return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_None_class, LDKCOption_CVec_NetAddressZZ_None_meth); - } - default: abort(); - } -} static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return NetAddress_clone(&*owner->contents.result); @@ -8764,13 +8859,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod return ret_ref; } -static inline struct LDKFundingLocked CResult_FundingLockedDecodeErrorZ_get_ok(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return FundingLocked_clone(&*owner->contents.result); + return ChannelReady_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_FundingLockedDecodeErrorZ* owner_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(owner & ~1); - LDKFundingLocked ret_var = CResult_FundingLockedDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(owner & ~1); + LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -8782,13 +8877,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod return ret_ref; } -static inline struct LDKDecodeError CResult_FundingLockedDecodeErrorZ_get_err(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_FundingLockedDecodeErrorZ* owner_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_FundingLockedDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -10207,15 +10302,17 @@ 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 LDKListen_JCalls { +typedef struct LDKScore_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID block_connected_meth; - jmethodID block_disconnected_meth; -} LDKListen_JCalls; -static void LDKListen_JCalls_free(void* this_arg) { - LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; + jmethodID channel_penalty_msat_meth; + jmethodID payment_path_failed_meth; + jmethodID payment_path_successful_meth; + jmethodID write_meth; +} LDKScore_JCalls; +static void LDKScore_JCalls_free(void* this_arg) { + LDKScore_JCalls *j_calls = (LDKScore_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); @@ -10231,8 +10328,8 @@ static void LDKListen_JCalls_free(void* this_arg) { FREE(j_calls); } } -void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { - LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; +uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) { + LDKScore_JCalls *j_calls = (LDKScore_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) { @@ -10240,23 +10337,50 @@ void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uin } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKu8slice block_var = block; - int8_tArray block_arr = (*env)->NewByteArray(env, block_var.datalen); - (*env)->SetByteArrayRegion(env, block_arr, 0, block_var.datalen, block_var.data); - int32_t height_conv = height; + int64_t short_channel_id_conv = short_channel_id; + LDKNodeId source_var = *source; + int64_t source_ref = 0; + source_var = NodeId_clone(&source_var); + CHECK((((uintptr_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); + source_ref = (uintptr_t)source_var.inner; + if (source_var.is_owned) { + source_ref |= 1; + } + LDKNodeId target_var = *target; + int64_t target_ref = 0; + target_var = NodeId_clone(&target_var); + CHECK((((uintptr_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); + target_ref = (uintptr_t)target_var.inner; + if (target_var.is_owned) { + target_ref |= 1; + } + LDKChannelUsage usage_var = usage; + int64_t usage_ref = 0; + CHECK((((uintptr_t)usage_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&usage_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var); + usage_ref = (uintptr_t)usage_var.inner; + if (usage_var.is_owned) { + usage_ref |= 1; + } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height_conv); + int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id_conv, source_ref, target_ref, usage_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception."); + (*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } + return ret; } -void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { - LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; +void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { + LDKScore_JCalls *j_calls = (LDKScore_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) { @@ -10264,82 +10388,224 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h } else { DO_ASSERT(get_jenv_res == JNI_OK); } - int8_tArray header_arr = (*env)->NewByteArray(env, 80); - (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); - int32_t height_conv = height; + LDKCVec_RouteHopZ path_var = path; + int64_tArray path_arr = NULL; + path_arr = (*env)->NewLongArray(env, path_var.datalen); + int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + int64_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; + if (path_conv_10_var.is_owned) { + path_conv_10_ref |= 1; + } + path_arr_ptr[k] = path_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); + FREE(path_var.data); + int64_t short_channel_id_conv = short_channel_id; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height_conv); + (*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_arr, short_channel_id_conv); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception."); + (*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } } -static void LDKListen_JCalls_cloned(LDKListen* new_obj) { - LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; +void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) { + LDKScore_JCalls *j_calls = (LDKScore_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); + } + LDKCVec_RouteHopZ path_var = path; + int64_tArray path_arr = NULL; + path_arr = (*env)->NewLongArray(env, path_var.datalen); + int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + int64_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; + if (path_conv_10_var.is_owned) { + path_conv_10_ref |= 1; + } + path_arr_ptr[k] = path_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); + FREE(path_var.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception."); + } + LDKCVec_u8Z ret_ref; + ret_ref.datalen = (*env)->GetArrayLength(env, ret); + ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_ref; +} +static void LDKScore_JCalls_cloned(LDKScore* new_obj) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } -static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) { +static inline LDKScore LDKScore_init (JNIEnv *env, jclass clz, jobject o) { jclass c = (*env)->GetObjectClass(env, o); CHECK(c != NULL); - LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls"); + LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls"); atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BI)V"); - CHECK(calls->block_connected_meth != NULL); - calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V"); - CHECK(calls->block_disconnected_meth != NULL); + calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJ)J"); + CHECK(calls->channel_penalty_msat_meth != NULL); + calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "([JJ)V"); + CHECK(calls->payment_path_failed_meth != NULL); + calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "([J)V"); + CHECK(calls->payment_path_successful_meth != NULL); + calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B"); + CHECK(calls->write_meth != NULL); - LDKListen ret = { + LDKScore ret = { .this_arg = (void*) calls, - .block_connected = block_connected_LDKListen_jcall, - .block_disconnected = block_disconnected_LDKListen_jcall, - .free = LDKListen_JCalls_free, + .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall, + .payment_path_failed = payment_path_failed_LDKScore_jcall, + .payment_path_successful = payment_path_successful_LDKScore_jcall, + .write = write_LDKScore_jcall, + .free = LDKScore_JCalls_free, }; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, jclass clz, jobject o) { - LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen"); - *res_ptr = LDKListen_init(env, clz, o); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKScore_1new(JNIEnv *env, jclass clz, jobject o) { + LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore"); + *res_ptr = LDKScore_init(env, clz, o); return (uint64_t)res_ptr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray block, int32_t height) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t source, int64_t target, int64_t usage) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; - LDKu8slice block_ref; - block_ref.datalen = (*env)->GetArrayLength(env, block); - block_ref.data = (*env)->GetByteArrayElements (env, block, NULL); - (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height); - (*env)->ReleaseByteArrayElements(env, block, (int8_t*)block_ref.data, 0); + LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; + LDKNodeId source_conv; + source_conv.inner = (void*)(source & (~1)); + source_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + LDKNodeId target_conv; + target_conv.inner = (void*)(target & (~1)); + target_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + LDKChannelUsage usage_conv; + usage_conv.inner = (void*)(usage & (~1)); + usage_conv.is_owned = (usage & 1) || (usage == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv); + usage_conv = ChannelUsage_clone(&usage_conv); + int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height); + LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; + LDKCVec_RouteHopZ path_constr; + path_constr.datalen = (*env)->GetArrayLength(env, path); + if (path_constr.datalen > 0) + path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + path_constr.data = NULL; + int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); + for (size_t k = 0; k < path_constr.datalen; k++) { + int64_t path_conv_10 = path_vals[k]; + LDKRouteHop path_conv_10_conv; + path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); + path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); + path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); + path_constr.data[k] = path_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); + (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id); } -typedef struct LDKConfirm_JCalls { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; + LDKCVec_RouteHopZ path_constr; + path_constr.datalen = (*env)->GetArrayLength(env, path); + if (path_constr.datalen > 0) + path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + path_constr.data = NULL; + int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); + for (size_t k = 0; k < path_constr.datalen; k++) { + int64_t path_conv_10 = path_vals[k]; + LDKRouteHop path_conv_10_conv; + path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); + path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); + path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); + path_constr.data[k] = path_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); + (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; + LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +typedef struct LDKPersister_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID transactions_confirmed_meth; - jmethodID transaction_unconfirmed_meth; - jmethodID best_block_updated_meth; - jmethodID get_relevant_txids_meth; -} LDKConfirm_JCalls; -static void LDKConfirm_JCalls_free(void* this_arg) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; + jmethodID persist_manager_meth; + jmethodID persist_graph_meth; + jmethodID persist_scorer_meth; +} LDKPersister_JCalls; +static void LDKPersister_JCalls_free(void* this_arg) { + LDKPersister_JCalls *j_calls = (LDKPersister_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); @@ -10355,8 +10621,8 @@ static void LDKConfirm_JCalls_free(void* this_arg) { FREE(j_calls); } } -void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; +LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) { + LDKPersister_JCalls *j_calls = (LDKPersister_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) { @@ -10364,33 +10630,34 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t } else { DO_ASSERT(get_jenv_res == JNI_OK); } - int8_tArray header_arr = (*env)->NewByteArray(env, 80); - (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); - LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata; - int64_tArray txdata_arr = NULL; - txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen); - int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL); - for (size_t c = 0; c < txdata_var.datalen; c++) { - LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *txdata_conv_28_conv = txdata_var.data[c]; - txdata_arr_ptr[c] = ((int64_t)txdata_conv_28_conv); + LDKChannelManager channel_manager_var = *channel_manager; + int64_t channel_manager_ref = 0; + // WARNING: we may need a move here but no clone is available for LDKChannelManager + CHECK((((uintptr_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); + channel_manager_ref = (uintptr_t)channel_manager_var.inner; + if (channel_manager_var.is_owned) { + channel_manager_ref |= 1; } - (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0); - FREE(txdata_var.data); - int32_t height_conv = height; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception."); + (*env)->FatalError(env, "A call to persist_manager in LDKPersister from rust threw an exception."); } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } + return ret_conv; } -void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; +LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) { + LDKPersister_JCalls *j_calls = (LDKPersister_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) { @@ -10398,44 +10665,34 @@ void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_ } else { DO_ASSERT(get_jenv_res == JNI_OK); } - int8_tArray txid_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_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); + LDKNetworkGraph network_graph_var = *network_graph; + int64_t network_graph_ref = 0; + // WARNING: we may need a move here but no clone is available for LDKNetworkGraph + CHECK((((uintptr_t)network_graph_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&network_graph_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var); + network_graph_ref = (uintptr_t)network_graph_var.inner; + if (network_graph_var.is_owned) { + network_graph_ref |= 1; } - int8_tArray header_arr = (*env)->NewByteArray(env, 80); - (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); - int32_t height_conv = height; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_graph_meth, network_graph_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception."); + (*env)->FatalError(env, "A call to persist_graph in LDKPersister from rust threw an exception."); } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } + return ret_conv; } -LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; +LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKMultiThreadedLockableScore * scorer) { + LDKPersister_JCalls *j_calls = (LDKPersister_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) { @@ -10443,142 +10700,113 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { } else { DO_ASSERT(get_jenv_res == JNI_OK); } + LDKMultiThreadedLockableScore scorer_var = *scorer; + int64_t scorer_ref = 0; + // WARNING: we may need a move here but no clone is available for LDKMultiThreadedLockableScore + CHECK((((uintptr_t)scorer_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&scorer_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_var); + scorer_ref = (uintptr_t)scorer_var.inner; + if (scorer_var.is_owned) { + scorer_ref |= 1; + } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_scorer_meth, scorer_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception."); - } - LDKCVec_TxidZ ret_constr; - ret_constr.datalen = (*env)->GetArrayLength(env, ret); - if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); - else - ret_constr.data = NULL; - for (size_t i = 0; i < ret_constr.datalen; i++) { - int8_tArray ret_conv_8 = (*env)->GetObjectArrayElement(env, ret, i); - LDKThirtyTwoBytes ret_conv_8_ref; - CHECK((*env)->GetArrayLength(env, ret_conv_8) == 32); - (*env)->GetByteArrayRegion(env, ret_conv_8, 0, 32, ret_conv_8_ref.data); - ret_constr.data[i] = ret_conv_8_ref; + (*env)->FatalError(env, "A call to persist_scorer in LDKPersister from rust threw an exception."); } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } - return ret_constr; + return ret_conv; } -static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg; +static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } -static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) { +static inline LDKPersister LDKPersister_init (JNIEnv *env, jclass clz, jobject o) { jclass c = (*env)->GetObjectClass(env, o); CHECK(c != NULL); - LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls"); + LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls"); atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->transactions_confirmed_meth = (*env)->GetMethodID(env, c, "transactions_confirmed", "([B[JI)V"); - CHECK(calls->transactions_confirmed_meth != NULL); - calls->transaction_unconfirmed_meth = (*env)->GetMethodID(env, c, "transaction_unconfirmed", "([B)V"); - CHECK(calls->transaction_unconfirmed_meth != NULL); - calls->best_block_updated_meth = (*env)->GetMethodID(env, c, "best_block_updated", "([BI)V"); - CHECK(calls->best_block_updated_meth != NULL); - calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[[B"); - CHECK(calls->get_relevant_txids_meth != NULL); + calls->persist_manager_meth = (*env)->GetMethodID(env, c, "persist_manager", "(J)J"); + CHECK(calls->persist_manager_meth != NULL); + calls->persist_graph_meth = (*env)->GetMethodID(env, c, "persist_graph", "(J)J"); + CHECK(calls->persist_graph_meth != NULL); + calls->persist_scorer_meth = (*env)->GetMethodID(env, c, "persist_scorer", "(J)J"); + CHECK(calls->persist_scorer_meth != NULL); - LDKConfirm ret = { + LDKPersister ret = { .this_arg = (void*) calls, - .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall, - .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall, - .best_block_updated = best_block_updated_LDKConfirm_jcall, - .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall, - .free = LDKConfirm_JCalls_free, + .persist_manager = persist_manager_LDKPersister_jcall, + .persist_graph = persist_graph_LDKPersister_jcall, + .persist_scorer = persist_scorer_LDKPersister_jcall, + .free = LDKPersister_JCalls_free, }; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new(JNIEnv *env, jclass clz, jobject o) { - LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *res_ptr = LDKConfirm_init(env, clz, o); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new(JNIEnv *env, jclass clz, jobject o) { + LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister"); + *res_ptr = LDKPersister_init(env, clz, o); return (uint64_t)res_ptr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); - (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; - unsigned char txid_arr[32]; - CHECK((*env)->GetArrayLength(env, txid) == 32); - (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); - unsigned char (*txid_ref)[32] = &txid_arr; - (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref); + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKChannelManager channel_manager_conv; + channel_manager_conv.inner = (void*)(channel_manager & (~1)); + channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height); + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = (void*)(network_graph & (~1)); + network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv); + return (int64_t)ret_conv; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1scorer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scorer) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; - LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKMultiThreadedLockableScore scorer_conv; + scorer_conv.inner = (void*)(scorer & (~1)); + scorer_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv); + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, &scorer_conv); + return (int64_t)ret_conv; } -typedef struct LDKPersist_JCalls { +typedef struct LDKListen_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID persist_new_channel_meth; - jmethodID update_persisted_channel_meth; -} LDKPersist_JCalls; -static void LDKPersist_JCalls_free(void* this_arg) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + jmethodID filtered_block_connected_meth; + jmethodID block_connected_meth; + jmethodID block_disconnected_meth; +} LDKListen_JCalls; +static void LDKListen_JCalls_free(void* this_arg) { + LDKListen_JCalls *j_calls = (LDKListen_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); @@ -10594,8 +10822,8 @@ static void LDKPersist_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; +void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) { + LDKListen_JCalls *j_calls = (LDKListen_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) { @@ -10603,14 +10831,441 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKOutPoint channel_id_var = channel_id; - int64_t channel_id_ref = 0; - CHECK((((uintptr_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = (uintptr_t)channel_id_var.inner; - if (channel_id_var.is_owned) { - channel_id_ref |= 1; + int8_tArray header_arr = (*env)->NewByteArray(env, 80); + (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); + LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata; + int64_tArray txdata_arr = NULL; + txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen); + int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL); + for (size_t c = 0; c < txdata_var.datalen; c++) { + LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *txdata_conv_28_conv = txdata_var.data[c]; + txdata_arr_ptr[c] = ((int64_t)txdata_conv_28_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0); + FREE(txdata_var.data); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->filtered_block_connected_meth, header_arr, txdata_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to filtered_block_connected in LDKListen from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { + LDKListen_JCalls *j_calls = (LDKListen_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); + } + LDKu8slice block_var = block; + int8_tArray block_arr = (*env)->NewByteArray(env, block_var.datalen); + (*env)->SetByteArrayRegion(env, block_arr, 0, block_var.datalen, block_var.data); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { + LDKListen_JCalls *j_calls = (LDKListen_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 header_arr = (*env)->NewByteArray(env, 80); + (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +static void LDKListen_JCalls_cloned(LDKListen* new_obj) { + LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->filtered_block_connected_meth = (*env)->GetMethodID(env, c, "filtered_block_connected", "([B[JI)V"); + CHECK(calls->filtered_block_connected_meth != NULL); + calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BI)V"); + CHECK(calls->block_connected_meth != NULL); + calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V"); + CHECK(calls->block_disconnected_meth != NULL); + + LDKListen ret = { + .this_arg = (void*) calls, + .filtered_block_connected = filtered_block_connected_LDKListen_jcall, + .block_connected = block_connected_LDKListen_jcall, + .block_disconnected = block_disconnected_LDKListen_jcall, + .free = LDKListen_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, jclass clz, jobject o) { + LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen"); + *res_ptr = LDKListen_init(env, clz, o); + return (uint64_t)res_ptr; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1filtered_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); + (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray block, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; + LDKu8slice block_ref; + block_ref.datalen = (*env)->GetArrayLength(env, block); + block_ref.data = (*env)->GetByteArrayElements (env, block, NULL); + (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height); + (*env)->ReleaseByteArrayElements(env, block, (int8_t*)block_ref.data, 0); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height); +} + +typedef struct LDKConfirm_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID transactions_confirmed_meth; + jmethodID transaction_unconfirmed_meth; + jmethodID best_block_updated_meth; + jmethodID get_relevant_txids_meth; +} LDKConfirm_JCalls; +static void LDKConfirm_JCalls_free(void* this_arg) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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); + } +} +void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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 header_arr = (*env)->NewByteArray(env, 80); + (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); + LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata; + int64_tArray txdata_arr = NULL; + txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen); + int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL); + for (size_t c = 0; c < txdata_var.datalen; c++) { + LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *txdata_conv_28_conv = txdata_var.data[c]; + txdata_arr_ptr[c] = ((int64_t)txdata_conv_28_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0); + FREE(txdata_var.data); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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 txid_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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 header_arr = (*env)->NewByteArray(env, 80); + (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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); + jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception."); + } + LDKCVec_TxidZ ret_constr; + ret_constr.datalen = (*env)->GetArrayLength(env, ret); + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); + else + ret_constr.data = NULL; + for (size_t i = 0; i < ret_constr.datalen; i++) { + int8_tArray ret_conv_8 = (*env)->GetObjectArrayElement(env, ret, i); + LDKThirtyTwoBytes ret_conv_8_ref; + CHECK((*env)->GetArrayLength(env, ret_conv_8) == 32); + (*env)->GetByteArrayRegion(env, ret_conv_8, 0, 32, ret_conv_8_ref.data); + ret_constr.data[i] = ret_conv_8_ref; + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_constr; +} +static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->transactions_confirmed_meth = (*env)->GetMethodID(env, c, "transactions_confirmed", "([B[JI)V"); + CHECK(calls->transactions_confirmed_meth != NULL); + calls->transaction_unconfirmed_meth = (*env)->GetMethodID(env, c, "transaction_unconfirmed", "([B)V"); + CHECK(calls->transaction_unconfirmed_meth != NULL); + calls->best_block_updated_meth = (*env)->GetMethodID(env, c, "best_block_updated", "([BI)V"); + CHECK(calls->best_block_updated_meth != NULL); + calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[[B"); + CHECK(calls->get_relevant_txids_meth != NULL); + + LDKConfirm ret = { + .this_arg = (void*) calls, + .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall, + .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall, + .best_block_updated = best_block_updated_LDKConfirm_jcall, + .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall, + .free = LDKConfirm_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new(JNIEnv *env, jclass clz, jobject o) { + LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *res_ptr = LDKConfirm_init(env, clz, o); + return (uint64_t)res_ptr; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); + (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; + unsigned char txid_arr[32]; + CHECK((*env)->GetArrayLength(env, txid) == 32); + (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); + unsigned char (*txid_ref)[32] = &txid_arr; + (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height); +} + +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; + LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; +} + +typedef struct LDKPersist_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID persist_new_channel_meth; + jmethodID update_persisted_channel_meth; +} LDKPersist_JCalls; +static void LDKPersist_JCalls_free(void* this_arg) { + LDKPersist_JCalls *j_calls = (LDKPersist_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_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + 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); + } + LDKOutPoint channel_id_var = channel_id; + int64_t channel_id_ref = 0; + CHECK((((uintptr_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = (uintptr_t)channel_id_var.inner; + if (channel_id_var.is_owned) { + channel_id_ref |= 1; } LDKChannelMonitor data_var = *data; int64_t data_ref = 0; @@ -10800,7 +11455,7 @@ typedef struct LDKChannelMessageHandler_JCalls { jmethodID handle_accept_channel_meth; jmethodID handle_funding_created_meth; jmethodID handle_funding_signed_meth; - jmethodID handle_funding_locked_meth; + jmethodID handle_channel_ready_meth; jmethodID handle_shutdown_meth; jmethodID handle_closing_signed_meth; jmethodID handle_update_add_htlc_meth; @@ -10980,7 +11635,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } } -void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) { +void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) { 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); @@ -10991,9 +11646,9 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, } int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKFundingLocked msg_var = *msg; + LDKChannelReady msg_var = *msg; int64_t msg_ref = 0; - msg_var = FundingLocked_clone(&msg_var); + msg_var = ChannelReady_clone(&msg_var); CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); @@ -11003,10 +11658,10 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref); + (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_ready_meth, their_node_id_arr, msg_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to handle_funding_locked in LDKChannelMessageHandler from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_channel_ready in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -11513,8 +12168,8 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *en CHECK(calls->handle_funding_created_meth != NULL); calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "([BJ)V"); CHECK(calls->handle_funding_signed_meth != NULL); - calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "([BJ)V"); - CHECK(calls->handle_funding_locked_meth != NULL); + calls->handle_channel_ready_meth = (*env)->GetMethodID(env, c, "handle_channel_ready", "([BJ)V"); + CHECK(calls->handle_channel_ready_meth != NULL); calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJJ)V"); CHECK(calls->handle_shutdown_meth != NULL); calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "([BJ)V"); @@ -11552,7 +12207,7 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *en .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall, .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall, .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall, - .handle_funding_locked = handle_funding_locked_LDKChannelMessageHandler_jcall, + .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall, .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall, .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall, .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall, @@ -11651,18 +12306,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)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); - LDKFundingLocked msg_conv; + LDKChannelReady msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) { @@ -12993,288 +13648,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1 default: abort(); } } -typedef struct LDKScore_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID channel_penalty_msat_meth; - jmethodID payment_path_failed_meth; - jmethodID payment_path_successful_meth; - jmethodID write_meth; -} LDKScore_JCalls; -static void LDKScore_JCalls_free(void* this_arg) { - LDKScore_JCalls *j_calls = (LDKScore_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); - } -} -uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, uint64_t capacity_msat, const LDKNodeId * source, const LDKNodeId * target) { - LDKScore_JCalls *j_calls = (LDKScore_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); - } - int64_t short_channel_id_conv = short_channel_id; - int64_t send_amt_msat_conv = send_amt_msat; - int64_t capacity_msat_conv = capacity_msat; - LDKNodeId source_var = *source; - int64_t source_ref = 0; - source_var = NodeId_clone(&source_var); - CHECK((((uintptr_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); - source_ref = (uintptr_t)source_var.inner; - if (source_var.is_owned) { - source_ref |= 1; - } - LDKNodeId target_var = *target; - int64_t target_ref = 0; - target_var = NodeId_clone(&target_var); - CHECK((((uintptr_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); - target_ref = (uintptr_t)target_var.inner; - if (target_var.is_owned) { - target_ref |= 1; - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id_conv, send_amt_msat_conv, capacity_msat_conv, source_ref, target_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret; -} -void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { - LDKScore_JCalls *j_calls = (LDKScore_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); - } - LDKCVec_RouteHopZ path_var = path; - int64_tArray path_arr = NULL; - path_arr = (*env)->NewLongArray(env, path_var.datalen); - int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - int64_t path_conv_10_ref = 0; - CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; - if (path_conv_10_var.is_owned) { - path_conv_10_ref |= 1; - } - path_arr_ptr[k] = path_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); - FREE(path_var.data); - int64_t short_channel_id_conv = short_channel_id; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_arr, short_channel_id_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) { - LDKScore_JCalls *j_calls = (LDKScore_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); - } - LDKCVec_RouteHopZ path_var = path; - int64_tArray path_arr = NULL; - path_arr = (*env)->NewLongArray(env, path_var.datalen); - int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - int64_t path_conv_10_ref = 0; - CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; - if (path_conv_10_var.is_owned) { - path_conv_10_ref |= 1; - } - path_arr_ptr[k] = path_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); - FREE(path_var.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception."); - } - LDKCVec_u8Z ret_ref; - ret_ref.datalen = (*env)->GetArrayLength(env, ret); - ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_ref; -} -static void LDKScore_JCalls_cloned(LDKScore* new_obj) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKScore LDKScore_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJJ)J"); - CHECK(calls->channel_penalty_msat_meth != NULL); - calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "([JJ)V"); - CHECK(calls->payment_path_failed_meth != NULL); - calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "([J)V"); - CHECK(calls->payment_path_successful_meth != NULL); - calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B"); - CHECK(calls->write_meth != NULL); - - LDKScore ret = { - .this_arg = (void*) calls, - .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall, - .payment_path_failed = payment_path_failed_LDKScore_jcall, - .payment_path_successful = payment_path_successful_LDKScore_jcall, - .write = write_LDKScore_jcall, - .free = LDKScore_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKScore_1new(JNIEnv *env, jclass clz, jobject o) { - LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore"); - *res_ptr = LDKScore_init(env, clz, o); - return (uint64_t)res_ptr; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t send_amt_msat, int64_t capacity_msat, int64_t source, int64_t target) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKNodeId source_conv; - source_conv.inner = (void*)(source & (~1)); - source_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - LDKNodeId target_conv; - target_conv.inner = (void*)(target & (~1)); - target_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, send_amt_msat, capacity_msat, &source_conv, &target_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = (*env)->GetArrayLength(env, path); - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); - for (size_t k = 0; k < path_constr.datalen; k++) { - int64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); - path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); - (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = (*env)->GetArrayLength(env, path); - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); - for (size_t k = 0; k < path_constr.datalen; k++) { - int64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); - path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); - (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - typedef struct LDKLockableScore_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -13362,155 +13735,56 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock(JNIEnv return (int64_t)ret_ret; } -typedef struct LDKPersister_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID persist_manager_meth; - jmethodID persist_graph_meth; -} LDKPersister_JCalls; -static void LDKPersister_JCalls_free(void* this_arg) { - LDKPersister_JCalls *j_calls = (LDKPersister_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); +static jclass LDKGossipSync_P2P_class = NULL; +static jmethodID LDKGossipSync_P2P_meth = NULL; +static jclass LDKGossipSync_Rapid_class = NULL; +static jmethodID LDKGossipSync_Rapid_meth = NULL; +static jclass LDKGossipSync_None_class = NULL; +static jmethodID LDKGossipSync_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGossipSync_init (JNIEnv *env, jclass clz) { + LDKGossipSync_P2P_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$P2P")); + CHECK(LDKGossipSync_P2P_class != NULL); + LDKGossipSync_P2P_meth = (*env)->GetMethodID(env, LDKGossipSync_P2P_class, "", "(J)V"); + CHECK(LDKGossipSync_P2P_meth != NULL); + LDKGossipSync_Rapid_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$Rapid")); + CHECK(LDKGossipSync_Rapid_class != NULL); + LDKGossipSync_Rapid_meth = (*env)->GetMethodID(env, LDKGossipSync_Rapid_class, "", "(J)V"); + CHECK(LDKGossipSync_Rapid_meth != NULL); + LDKGossipSync_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$None")); + CHECK(LDKGossipSync_None_class != NULL); + LDKGossipSync_None_meth = (*env)->GetMethodID(env, LDKGossipSync_None_class, "", "()V"); + CHECK(LDKGossipSync_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGossipSync_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKGossipSync *obj = (LDKGossipSync*)(ptr & ~1); + switch(obj->tag) { + case LDKGossipSync_P2P: { + LDKP2PGossipSync p2p_var = obj->p2p; + int64_t p2p_ref = 0; + CHECK((((uintptr_t)p2p_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&p2p_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var); + p2p_ref = (uintptr_t)p2p_var.inner & ~1; + return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref); } - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + case LDKGossipSync_Rapid: { + LDKRapidGossipSync rapid_var = obj->rapid; + int64_t rapid_ref = 0; + CHECK((((uintptr_t)rapid_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&rapid_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var); + rapid_ref = (uintptr_t)rapid_var.inner & ~1; + return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref); } - FREE(j_calls); - } -} -LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) { - LDKPersister_JCalls *j_calls = (LDKPersister_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); - } - LDKChannelManager channel_manager_var = *channel_manager; - int64_t channel_manager_ref = 0; - // WARNING: we may need a move here but no clone is available for LDKChannelManager - CHECK((((uintptr_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); - channel_manager_ref = (uintptr_t)channel_manager_var.inner; - if (channel_manager_var.is_owned) { - channel_manager_ref |= 1; - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to persist_manager in LDKPersister from rust threw an exception."); - } - void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); - FREE((void*)ret); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) { - LDKPersister_JCalls *j_calls = (LDKPersister_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); - } - LDKNetworkGraph network_graph_var = *network_graph; - int64_t network_graph_ref = 0; - network_graph_var = NetworkGraph_clone(&network_graph_var); - CHECK((((uintptr_t)network_graph_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&network_graph_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var); - network_graph_ref = (uintptr_t)network_graph_var.inner; - if (network_graph_var.is_owned) { - network_graph_ref |= 1; - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_graph_meth, network_graph_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to persist_graph in LDKPersister from rust threw an exception."); - } - void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); - FREE((void*)ret); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + case LDKGossipSync_None: { + return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth); + } + default: abort(); } - return ret_conv; } -static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKPersister LDKPersister_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->persist_manager_meth = (*env)->GetMethodID(env, c, "persist_manager", "(J)J"); - CHECK(calls->persist_manager_meth != NULL); - calls->persist_graph_meth = (*env)->GetMethodID(env, c, "persist_graph", "(J)J"); - CHECK(calls->persist_graph_meth != NULL); - - LDKPersister ret = { - .this_arg = (void*) calls, - .persist_manager = persist_manager_LDKPersister_jcall, - .persist_graph = persist_graph_LDKPersister_jcall, - .free = LDKPersister_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new(JNIEnv *env, jclass clz, jobject o) { - LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister"); - *res_ptr = LDKPersister_init(env, clz, o); - return (uint64_t)res_ptr; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - LDKChannelManager channel_manager_conv; - channel_manager_conv.inner = (void*)(channel_manager & (~1)); - channel_manager_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = (void*)(network_graph & (~1)); - network_graph_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv); - return (int64_t)ret_conv; -} - static jclass LDKFallback_SegWitProgram_class = NULL; static jmethodID LDKFallback_SegWitProgram_meth = NULL; static jclass LDKFallback_PubKeyHash_class = NULL; @@ -14071,6 +14345,36 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv return (int64_t)ret_conv; } +static jclass LDKRetry_Attempts_class = NULL; +static jmethodID LDKRetry_Attempts_meth = NULL; +static jclass LDKRetry_Timeout_class = NULL; +static jmethodID LDKRetry_Timeout_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) { + LDKRetry_Attempts_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts")); + CHECK(LDKRetry_Attempts_class != NULL); + LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "", "(J)V"); + CHECK(LDKRetry_Attempts_meth != NULL); + LDKRetry_Timeout_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout")); + CHECK(LDKRetry_Timeout_class != NULL); + LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "", "(J)V"); + CHECK(LDKRetry_Timeout_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKRetry *obj = (LDKRetry*)(ptr & ~1); + switch(obj->tag) { + case LDKRetry_Attempts: { + int64_t attempts_conv = obj->attempts; + return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv); + } + case LDKRetry_Timeout: { + int64_t timeout_conv = obj->timeout; + return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv); + } + default: abort(); + } +} JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) { LDKStr ret_str = _ldk_get_compiled_version(); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); @@ -15745,244 +16049,77 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); - o_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)o) & ~1)); - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKAccessError e_conv = LDKAccessError_from_java(env, e); - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1); - jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr); - FREE((void*)_res); - CResult_TxOutAccessErrorZ_free(_res_conv); -} - -static inline uintptr_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -static inline uintptr_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { - LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); - LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { - LDKTransaction b_ref; - b_ref.datalen = (*env)->GetArrayLength(env, b); - b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data); - b_ref.data_is_owned = true; - LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref); - return ((int64_t)ret_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr); - FREE((void*)_res); - C2Tuple_usizeTransactionZ_free(_res_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_usizeTransactionZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t c = 0; c < _res_constr.datalen; c++) { - int64_t _res_conv_28 = _res_vals[c]; - void* _res_conv_28_ptr = (void*)(((uintptr_t)_res_conv_28) & ~1); - CHECK_ACCESS(_res_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr); - FREE((void*)_res_conv_28); - _res_constr.data[c] = _res_conv_28_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_usizeTransactionZZ_free(_res_constr); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxidZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_TxidZ _res_constr; +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(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); + _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); - LDKThirtyTwoBytes _res_conv_8_ref; - CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data); + 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_TxidZ_free(_res_constr); + CVec_PublicKeyZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr); + o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uintptr_t)o) & ~1)); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_java(env, e); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1); - jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr); + LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); + CResult_PaymentPurposeDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); +static inline uintptr_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); - int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(orig & ~1); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_MonitorEventZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - void* _res_conv_14_ptr = (void*)(((uintptr_t)_res_conv_14) & ~1); - CHECK_ACCESS(_res_conv_14_ptr); - LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr); - FREE((void*)_res_conv_14); - _res_constr.data[o] = _res_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_MonitorEventZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr); - o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)o) & ~1)); - LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); - *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); - *ret_copy = COption_C2Tuple_usizeTransactionZZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr); - FREE((void*)_res); - COption_C2Tuple_usizeTransactionZZ_free(_res_conv); -} - -static inline uintptr_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { - LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); - *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; - int64_t ret_conv = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; - LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); - *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -16272,238 +16409,476 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free( CVec_MessageSendEventZ_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 = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = FixedPenaltyScorer_clone(&o_conv); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); + o_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)o) & ~1)); + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKAccessError e_conv = LDKAccessError_from_java(env, e); + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1); + jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr); + LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv); + CResult_TxOutAccessErrorZ_free(_res_conv); } -static inline uintptr_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(orig & ~1); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKScoringParameters o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ScoringParameters_clone(&o_conv); - LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { + LDKTransaction b_ref; + b_ref.datalen = (*env)->GetArrayLength(env, b); + b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data); + b_ref.data_is_owned = true; + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr); FREE((void*)_res); - CResult_ScoringParametersDecodeErrorZ_free(_res_conv); + C2Tuple_usizeTransactionZ_free(_res_conv); } -static inline uintptr_t CResult_ScoringParametersDecodeErrorZ_clone_ptr(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = CResult_ScoringParametersDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ScoringParametersDecodeErrorZ* arg_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ScoringParametersDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_usizeTransactionZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t c = 0; c < _res_constr.datalen; c++) { + int64_t _res_conv_28 = _res_vals[c]; + void* _res_conv_28_ptr = (void*)(((uintptr_t)_res_conv_28) & ~1); + CHECK_ACCESS(_res_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr); + FREE((void*)_res_conv_28); + _res_constr.data[c] = _res_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_usizeTransactionZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ScoringParametersDecodeErrorZ* orig_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(orig & ~1); - LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = CResult_ScoringParametersDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxidZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_TxidZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ 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); + LDKThirtyTwoBytes _res_conv_8_ref; + CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_TxidZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKScorer o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKScorer - LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); - *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok(); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); - *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_java(env, e); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ScorerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1); + jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr); + LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr); FREE((void*)_res); - CResult_ScorerDecodeErrorZ_free(_res_conv); + CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKProbabilisticScorer o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv); +static inline uintptr_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); return (int64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); + int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_MonitorEventZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_14 = _res_vals[o]; + void* _res_conv_14_ptr = (void*)(((uintptr_t)_res_conv_14) & ~1); + CHECK_ACCESS(_res_conv_14_ptr); + LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr); + FREE((void*)_res_conv_14); + _res_constr.data[o] = _res_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_MonitorEventZ_free(_res_constr); +} + +static inline uintptr_t C2Tuple_OutPointCVec_MonitorEventZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(orig & ~1); + LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_clone(orig_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKCVec_MonitorEventZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t o = 0; o < b_constr.datalen; o++) { + int64_t b_conv_14 = b_vals[o]; + void* b_conv_14_ptr = (void*)(((uintptr_t)b_conv_14) & ~1); + CHECK_ACCESS(b_conv_14_ptr); + LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr); + b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)b_conv_14) & ~1)); + b_constr.data[o] = b_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_new(a_conv, b_constr); + return ((int64_t)ret_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_OutPointCVec_MonitorEventZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(_res_ptr); FREE((void*)_res); - CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); + C2Tuple_OutPointCVec_MonitorEventZZ_free(_res_conv); } -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 = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - 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 (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorEventZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t m = 0; m < _res_constr.datalen; m++) { + int64_t _res_conv_38 = _res_vals[m]; + void* _res_conv_38_ptr = (void*)(((uintptr_t)_res_conv_38) & ~1); + CHECK_ACCESS(_res_conv_38_ptr); + LDKC2Tuple_OutPointCVec_MonitorEventZZ _res_conv_38_conv = *(LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(_res_conv_38_ptr); + FREE((void*)_res_conv_38); + _res_constr.data[m] = _res_conv_38_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr); + o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)o) & ~1)); + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -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*)(o & ~1); - jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); + LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr); FREE((void*)_res); - CResult_InitFeaturesDecodeErrorZ_free(_res_conv); + COption_C2Tuple_usizeTransactionZZ_free(_res_conv); } -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 = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - 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 (int64_t)ret_conv; +static inline uintptr_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } - +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; + int64_t ret_conv = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +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 = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = FixedPenaltyScorer_clone(&o_conv); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv); +} + +static inline uintptr_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(orig & ~1); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKProbabilisticScorer o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); +} + +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 = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + 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 (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +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*)(o & ~1); + 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 ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_InitFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uintptr_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 (int64_t)ret_conv; +} +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*)(arg & ~1); + 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*)(orig & ~1); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +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 = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + 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 (int64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); @@ -16530,6 +16905,24 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecode CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv); } +static inline uintptr_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 (int64_t)ret_conv; +} +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*)(arg & ~1); + 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*)(orig & ~1); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + 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 = (void*)(o & (~1)); @@ -16567,6 +16960,24 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErr CResult_NodeFeaturesDecodeErrorZ_free(_res_conv); } +static inline uintptr_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 (int64_t)ret_conv; +} +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*)(arg & ~1); + 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*)(orig & ~1); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInvoiceFeatures o_conv; o_conv.inner = (void*)(o & (~1)); @@ -16604,6 +17015,24 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecode CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv); } +static inline uintptr_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(orig & ~1); + LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + 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 = (void*)(o & (~1)); @@ -16641,4368 +17070,4400 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDe CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKDelayedPaymentOutputDescriptor o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); - FREE((void*)_res); - CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); -} - -static inline uintptr_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); +static inline uintptr_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 (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); +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*)(arg & ~1); + int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_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*)(orig & ~1); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKStaticPaymentOutputDescriptor o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); + o_conv = NodeId_clone(&o_conv); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); + LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); + CResult_NodeIdDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); - LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr); - o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)o) & ~1)); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv); + LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); + o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uintptr_t)o) & ~1)); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); + CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_PaymentPreimageZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ 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); - LDKThirtyTwoBytes _res_conv_8_ref; - CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data); - _res_constr.data[i] = _res_conv_8_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKAccess o_conv = *(LDKAccess*)(o_ptr); + if (o_conv.free == LDKAccess_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAccess_JCalls_cloned(&o_conv); } - CVec_PaymentPreimageZ_free(_res_constr); -} - -static inline uintptr_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { - LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); - *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); - LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); - *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv); - return ((int64_t)ret_conv); + LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); + *ret_copy = COption_AccessZ_some(o_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) { - LDKSignature a_ref; - CHECK((*env)->GetArrayLength(env, a) == 64); - (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form); - LDKCVec_SignatureZ b_constr; - b_constr.datalen = (*env)->GetArrayLength(env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - b_constr.data = NULL; - for (size_t i = 0; i < b_constr.datalen; i++) { - int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i); - LDKSignature b_conv_8_ref; - CHECK((*env)->GetArrayLength(env, b_conv_8) == 64); - (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form); - b_constr.data[i] = b_conv_8_ref; - } - LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); - *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); + *ret_copy = COption_AccessZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr); + LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv); + COption_AccessZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr); - o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_ok(o); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKLightningError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = LightningError_clone(&e_conv); + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1); + jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr); + LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); + CResult_boolLightningErrorZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); +static inline uintptr_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKSignature o_ref; - CHECK((*env)->GetArrayLength(env, o) == 64); - (*env)->GetByteArrayRegion(env, o, 0, 64, o_ref.compact_form); - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_err(); - return (int64_t)ret_conv; +static inline uintptr_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); + return ((int64_t)ret_conv); } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1); - jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); + int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr); - FREE((void*)_res); - CResult_SignatureNoneZ_free(_res_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv); + return ((int64_t)ret_conv); } -static inline uintptr_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv); - return ret_conv; -} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { + LDKChannelAnnouncement a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ChannelAnnouncement_clone(&a_conv); + LDKChannelUpdate b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ChannelUpdate_clone(&b_conv); + LDKChannelUpdate c_conv; + c_conv.inner = (void*)(c & (~1)); + c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = ChannelUpdate_clone(&c_conv); + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); + return ((int64_t)ret_conv); +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr); + FREE((void*)_res); + C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv); } -static inline uintptr_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) { - LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); - *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg); - return ((int64_t)ret_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t h = 0; h < _res_constr.datalen; h++) { + int64_t _res_conv_59 = _res_vals[h]; + void* _res_conv_59_ptr = (void*)(((uintptr_t)_res_conv_59) & ~1); + CHECK_ACCESS(_res_conv_59_ptr); + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr); + FREE((void*)_res_conv_59); + _res_constr.data[h] = _res_conv_59_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_NodeAnnouncementZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t s = 0; s < _res_constr.datalen; s++) { + int64_t _res_conv_18 = _res_vals[s]; + LDKNodeAnnouncement _res_conv_18_conv; + _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1)); + _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv); + _res_constr.data[s] = _res_conv_18_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_NodeAnnouncementZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)(orig & ~1); - LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); - *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_ok(); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { - LDKSignature a_ref; - CHECK((*env)->GetArrayLength(env, a) == 64); - (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form); - LDKSignature b_ref; - CHECK((*env)->GetArrayLength(env, b) == 64); - (*env)->GetByteArrayRegion(env, b, 0, 64, b_ref.compact_form); - LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); - *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKLightningError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = LightningError_clone(&e_conv); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr); + LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_SignatureSignatureZ_free(_res_conv); + CResult_NoneLightningErrorZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr); - o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv); +static inline uintptr_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelUpdateInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelUpdateInfo_clone(&o_conv); + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr); + LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv); + CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg); +static inline uintptr_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(orig & ~1); - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKSecretKey o_ref; - CHECK((*env)->GetArrayLength(env, o) == 32); - (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes); - LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); - *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelInfo_clone(&o_conv); + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); - *ret_conv = CResult_SecretKeyNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)(o & ~1); - jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr); + LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SecretKeyNoneZ_free(_res_conv); + CResult_ChannelInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) { - LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); - *ret_conv = CResult_SecretKeyNoneZ_clone(arg); +static inline uintptr_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)(orig & ~1); - LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); - *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKSign o_conv = *(LDKSign*)(o_ptr); - if (o_conv.free == LDKSign_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSign_JCalls_cloned(&o_conv); - } - LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); - *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRoutingFees o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = RoutingFees_clone(&o_conv); + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); - *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr); + LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SignDecodeErrorZ_free(_res_conv); + CResult_RoutingFeesDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); - *ret_conv = CResult_SignDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); - LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); - *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_u5Z _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_NetAddressZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else _res_constr.data = NULL; - int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int8_t _res_conv_7 = _res_vals[h]; - - _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 }; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t m = 0; m < _res_constr.datalen; m++) { + int64_t _res_conv_12 = _res_vals[m]; + void* _res_conv_12_ptr = (void*)(((uintptr_t)_res_conv_12) & ~1); + CHECK_ACCESS(_res_conv_12_ptr); + LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr); + FREE((void*)_res_conv_12); + _res_constr.data[m] = _res_conv_12_conv; } - (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0); - CVec_u5Z_free(_res_constr); + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_NetAddressZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKRecoverableSignature o_ref; - CHECK((*env)->GetArrayLength(env, o) == 68); - (*env)->GetByteArrayRegion(env, o, 0, 68, o_ref.serialized_form); - LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeAnnouncementInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = NodeAnnouncementInfo_clone(&o_conv); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = CResult_RecoverableSignatureNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1); - jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_RecoverableSignatureNoneZ_free(_res_conv); + CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { - LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); +static inline uintptr_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); - LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv *env, jclass clz, int8_tArray _res) { - LDKCVec_u8Z _res_ref; - _res_ref.datalen = (*env)->GetArrayLength(env, _res); - _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); - CVec_u8Z_free(_res_ref); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_CVec_u8ZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_u64Z _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z 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); - LDKCVec_u8Z _res_conv_8_ref; - _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8); - _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data); - _res_constr.data[i] = _res_conv_8_ref; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t g = 0; g < _res_constr.datalen; g++) { + int64_t _res_conv_6 = _res_vals[g]; + _res_constr.data[g] = _res_conv_6; } - CVec_CVec_u8ZZ_free(_res_constr); + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_u64Z_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) { - LDKCVec_CVec_u8ZZ o_constr; - o_constr.datalen = (*env)->GetArrayLength(env, o); - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); - else - o_constr.data = NULL; - for (size_t i = 0; i < o_constr.datalen; i++) { - int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i); - LDKCVec_u8Z o_conv_8_ref; - o_conv_8_ref.datalen = (*env)->GetArrayLength(env, o_conv_8); - o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, o_conv_8, 0, o_conv_8_ref.datalen, o_conv_8_ref.data); - o_constr.data[i] = o_conv_8_ref; - } - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = NodeInfo_clone(&o_conv); + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1); - jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr); + LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); + CResult_NodeInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); +static inline uintptr_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInMemorySigner o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNetworkGraph o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = InMemorySigner_clone(&o_conv); - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); + // WARNING: we need a move here but no clone is available for LDKNetworkGraph + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr); + LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_InMemorySignerDecodeErrorZ_free(_res_conv); + CResult_NetworkGraphDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_NetAddressZ o_constr; + o_constr.datalen = (*env)->GetArrayLength(env, o); + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); + for (size_t m = 0; m < o_constr.datalen; m++) { + int64_t o_conv_12 = o_vals[m]; + void* o_conv_12_ptr = (void*)(((uintptr_t)o_conv_12) & ~1); + CHECK_ACCESS(o_conv_12_ptr); + LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr); + o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o_conv_12) & ~1)); + o_constr.data[m] = o_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_some(o_constr); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr); + FREE((void*)_res); + COption_CVec_NetAddressZZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_TxOutZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int64_t _res_conv_7 = _res_vals[h]; - void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); - CHECK_ACCESS(_res_conv_7_ptr); - LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr); - FREE((void*)_res_conv_7); - _res_constr.data[h] = _res_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_TxOutZ_free(_res_constr); +static inline uintptr_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; + int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKTransaction o_ref; - o_ref.datalen = (*env)->GetArrayLength(env, o); - o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data); - o_ref.data_is_owned = true; - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKDelayedPaymentOutputDescriptor o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1); - jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_TransactionNoneZ_free(_res_conv); + CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_clone(arg); +static inline uintptr_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { - LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); - *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKStaticPaymentOutputDescriptor o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); - LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); - *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKChannelMonitor b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = (b & 1) || (b == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = ChannelMonitor_clone(&b_conv); - LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); - *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_BlockHashChannelMonitorZ_free(_res_conv); + CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t j = 0; j < _res_constr.datalen; j++) { - int64_t _res_conv_35 = _res_vals[j]; - void* _res_conv_35_ptr = (void*)(((uintptr_t)_res_conv_35) & ~1); - CHECK_ACCESS(_res_conv_35_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr); - FREE((void*)_res_conv_35); - _res_constr.data[j] = _res_conv_35_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_BlockHashChannelMonitorZZ_free(_res_constr); +static inline uintptr_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { - LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o_constr; - o_constr.datalen = (*env)->GetArrayLength(env, o); - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements"); - else - o_constr.data = NULL; - int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - for (size_t j = 0; j < o_constr.datalen; j++) { - int64_t o_conv_35 = o_vals[j]; - void* o_conv_35_ptr = (void*)(((uintptr_t)o_conv_35) & ~1); - CHECK_ACCESS(o_conv_35_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr); - o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o_conv_35) & ~1)); - o_constr.data[j] = o_conv_35_conv; - } - (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKIOError e_conv = LDKIOError_from_java(env, e); - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr); + o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)o) & ~1)); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1); - jboolean ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); + CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) { - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg); +static inline uintptr_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1); - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) { - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = COption_u16Z_some(o); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_PaymentPreimageZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ 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); + LDKThirtyTwoBytes _res_conv_8_ref; + CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_PaymentPreimageZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none(JNIEnv *env, jclass clz) { - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = COption_u16Z_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); + return ((int64_t)ret_conv); } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr); - FREE((void*)_res); - COption_u16Z_free(_res_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); + return ret_conv; } -static inline uintptr_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = COption_u16Z_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; - int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) { + LDKSignature a_ref; + CHECK((*env)->GetArrayLength(env, a) == 64); + (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form); + LDKCVec_SignatureZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + b_constr.data = NULL; + for (size_t i = 0; i < b_constr.datalen; i++) { + int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i); + LDKSignature b_conv_8_ref; + CHECK((*env)->GetArrayLength(env, b_conv_8) == 64); + (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form); + b_constr.data[i] = b_conv_8_ref; + } + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr); + return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = COption_u16Z_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr); + FREE((void*)_res); + C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv); } -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_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr); + o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); return (int64_t)ret_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*)(o & ~1); - jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_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_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_NoneAPIErrorZ_free(_res_conv); + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); } -static inline uintptr_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 uintptr_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); return (int64_t)ret_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*)(arg & ~1); - int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_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*)(orig & ~1); - 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_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv); return (int64_t)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; - _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"); - 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 = (void*)(((uintptr_t)_res_conv_22) & ~1); - CHECK_ACCESS(_res_conv_22_ptr); - LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr); - FREE((void*)_res_conv_22); - _res_constr.data[w] = _res_conv_22_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_CResult_NoneAPIErrorZZ_free(_res_constr); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_APIErrorZ _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"); - 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 = (void*)(((uintptr_t)_res_conv_10) & ~1); - CHECK_ACCESS(_res_conv_10_ptr); - LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr); - FREE((void*)_res_conv_10); - _res_constr.data[k] = _res_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_APIErrorZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_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__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = CResult__u832APIErrorZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKSignature o_ref; + CHECK((*env)->GetArrayLength(env, o) == 64); + (*env)->GetByteArrayRegion(env, o, 0, 64, o_ref.compact_form); + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = CResult__u832APIErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1); - jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1); + jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr); + LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr); FREE((void*)_res); - CResult__u832APIErrorZ_free(_res_conv); + CResult_SignatureNoneZ_free(_res_conv); } -static inline uintptr_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { - LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = CResult__u832APIErrorZ_clone(arg); +static inline uintptr_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); - int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); - LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = CResult__u832APIErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) { + LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); + *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)(orig & ~1); + LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); + *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { + LDKSignature a_ref; + CHECK((*env)->GetArrayLength(env, a) == 64); + (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form); + LDKSignature b_ref; + CHECK((*env)->GetArrayLength(env, b) == 64); + (*env)->GetByteArrayRegion(env, b, 0, 64, b_ref.compact_form); + LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); + *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr); + LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); -} - -static inline uintptr_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv); - return (int64_t)ret_conv; + C2Tuple_SignatureSignatureZ_free(_res_conv); } -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_1C2Tuple_1SignatureSignatureZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr); + o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err(); return (int64_t)ret_conv; } -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*)(o & ~1); - jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_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_1C2Tuple_1SignatureSignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); + LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_NonePaymentSendFailureZ_free(_res_conv); + CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv); } -static inline uintptr_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 uintptr_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg); return (int64_t)ret_conv; } -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*)(arg & ~1); - int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_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*)(orig & ~1); - 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_1C2Tuple_1SignatureSignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(orig & ~1); + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { - LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); - *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKSecretKey o_ref; + CHECK((*env)->GetArrayLength(env, o) == 32); + (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes); + LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); + *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); - LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); - *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); + *ret_conv = CResult_SecretKeyNoneZ_err(); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKThirtyTwoBytes b_ref; - CHECK((*env)->GetArrayLength(env, b) == 32); - (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); - LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); - *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)(o & ~1); + jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr); + LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_PaymentHashPaymentIdZ_free(_res_conv); + CResult_SecretKeyNoneZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +static inline uintptr_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) { + LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); + *ret_conv = CResult_SecretKeyNoneZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)(orig & ~1); + LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); + *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); - LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv); + LDKSign o_conv = *(LDKSign*)(o_ptr); + if (o_conv.free == LDKSign_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSign_JCalls_cloned(&o_conv); + } + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr); + LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv); + CResult_SignDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); +static inline uintptr_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_NetAddressZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_u5Z _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); else _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t m = 0; m < _res_constr.datalen; m++) { - int64_t _res_conv_12 = _res_vals[m]; - void* _res_conv_12_ptr = (void*)(((uintptr_t)_res_conv_12) & ~1); - CHECK_ACCESS(_res_conv_12_ptr); - LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr); - FREE((void*)_res_conv_12); - _res_constr.data[m] = _res_conv_12_conv; + int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL); + for (size_t h = 0; h < _res_constr.datalen; h++) { + int8_t _res_conv_7 = _res_vals[h]; + + _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 }; } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_NetAddressZ_free(_res_constr); -} - -static inline uintptr_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { - LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); - *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); - LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); - *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKThirtyTwoBytes b_ref; - CHECK((*env)->GetArrayLength(env, b) == 32); - (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); - LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); - *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref); - return ((int64_t)ret_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr); - FREE((void*)_res); - C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv); + (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0); + CVec_u5Z_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKRecoverableSignature o_ref; + CHECK((*env)->GetArrayLength(env, o) == 68); + (*env)->GetByteArrayRegion(env, o, 0, 68, o_ref.serialized_form); + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1); + jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr); + LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv); + CResult_RecoverableSignatureNoneZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg); +static inline uintptr_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv *env, jclass clz, int8_tArray _res) { + LDKCVec_u8Z _res_ref; + _res_ref.datalen = (*env)->GetArrayLength(env, _res); + _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); + CVec_u8Z_free(_res_ref); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_CVec_u8ZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ 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); + LDKCVec_u8Z _res_conv_8_ref; + _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8); + _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_CVec_u8ZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) { + LDKCVec_CVec_u8ZZ o_constr; + o_constr.datalen = (*env)->GetArrayLength(env, o); + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); + else + o_constr.data = NULL; + for (size_t i = 0; i < o_constr.datalen; i++) { + int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i); + LDKCVec_u8Z o_conv_8_ref; + o_conv_8_ref.datalen = (*env)->GetArrayLength(env, o_conv_8); + o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, o_conv_8, 0, o_conv_8_ref.datalen, o_conv_8_ref.data); + o_constr.data[i] = o_conv_8_ref; + } + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1); + jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr); + LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv); + CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg); +static inline uintptr_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_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_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInMemorySigner o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = InMemorySigner_clone(&o_conv); + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = CResult_PaymentSecretNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr); + LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentSecretNoneZ_free(_res_conv); + CResult_InMemorySignerDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) { - LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = CResult_PaymentSecretNoneZ_clone(arg); +static inline uintptr_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1); - LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_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_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_TxOutZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t h = 0; h < _res_constr.datalen; h++) { + int64_t _res_conv_7 = _res_vals[h]; + void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); + CHECK_ACCESS(_res_conv_7_ptr); + LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr); + FREE((void*)_res_conv_7); + _res_constr.data[h] = _res_conv_7_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_TxOutZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKTransaction o_ref; + o_ref.datalen = (*env)->GetArrayLength(env, o); + o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data); + o_ref.data_is_owned = true; + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1); + jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr); + LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentSecretAPIErrorZ_free(_res_conv); + CResult_TransactionNoneZ_free(_res_conv); } -static inline uintptr_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); +static inline uintptr_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); - LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_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_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKChannelMonitor b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ChannelMonitor_clone(&b_conv); + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr); + LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentPreimageAPIErrorZ_free(_res_conv); + C2Tuple_BlockHashChannelMonitorZ_free(_res_conv); } -static inline uintptr_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t j = 0; j < _res_constr.datalen; j++) { + int64_t _res_conv_35 = _res_vals[j]; + void* _res_conv_35_ptr = (void*)(((uintptr_t)_res_conv_35) & ~1); + CHECK_ACCESS(_res_conv_35_ptr); + LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr); + FREE((void*)_res_conv_35); + _res_constr.data[j] = _res_conv_35_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_BlockHashChannelMonitorZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o_constr; + o_constr.datalen = (*env)->GetArrayLength(env, o); + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); + for (size_t j = 0; j < o_constr.datalen; j++) { + int64_t o_conv_35 = o_vals[j]; + void* o_conv_35_ptr = (void*)(((uintptr_t)o_conv_35) & ~1); + CHECK_ACCESS(o_conv_35_ptr); + LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr); + o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o_conv_35) & ~1)); + o_constr.data[j] = o_conv_35_conv; + } + (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o_constr); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKIOError e_conv = LDKIOError_from_java(env, e); + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1); + jboolean ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1); - LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCounterpartyForwardingInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CounterpartyForwardingInfo_clone(&o_conv); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); +static inline uintptr_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg); return (int64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1); + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_some(o); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none(JNIEnv *env, jclass clz) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); + LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr); FREE((void*)_res); - CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); + COption_u16Z_free(_res_conv); } -static inline uintptr_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; +static inline uintptr_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; + int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelCounterparty o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelCounterparty_clone(&o_conv); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); +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 (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_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*)(o & ~1); + jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_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 ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); + LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); + CResult_NoneAPIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); +static inline uintptr_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 (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_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*)(arg & ~1); + int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_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*)(orig & ~1); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelDetails o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelDetails_clone(&o_conv); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_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; + _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"); + 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 = (void*)(((uintptr_t)_res_conv_22) & ~1); + CHECK_ACCESS(_res_conv_22_ptr); + LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr); + FREE((void*)_res_conv_22); + _res_constr.data[w] = _res_conv_22_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_CResult_NoneAPIErrorZZ_free(_res_constr); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_APIErrorZ _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"); + 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 = (void*)(((uintptr_t)_res_conv_10) & ~1); + CHECK_ACCESS(_res_conv_10_ptr); + LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr); + FREE((void*)_res_conv_10); + _res_constr.data[k] = _res_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_APIErrorZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_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__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1); + jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); + LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); + CResult__u832APIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); +static inline uintptr_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); + int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKPhantomRouteHints o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PhantomRouteHints_clone(&o_conv); - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); - CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv); + CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); } -static inline uintptr_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(orig & ~1); - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_ChannelMonitorZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t q = 0; q < _res_constr.datalen; q++) { - int64_t _res_conv_16 = _res_vals[q]; - LDKChannelMonitor _res_conv_16_conv; - _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); - _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); - _res_constr.data[q] = _res_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_ChannelMonitorZ_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(); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKChannelManager b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = (b & 1) || (b == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - // WARNING: we need a move here but no clone is available for LDKChannelManager - LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); - *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +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*)(o & ~1); + jboolean ret_conv = CResult_NonePaymentSendFailureZ_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) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr); + LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_BlockHashChannelManagerZ_free(_res_conv); + CResult_NonePaymentSendFailureZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr); - // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv); +static inline uintptr_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); return (int64_t)ret_conv; } +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*)(arg & ~1); + int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_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*)(orig & ~1); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv); +static inline uintptr_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKThirtyTwoBytes b_ref; + CHECK((*env)->GetArrayLength(env, b) == 32); + (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref); + return ((int64_t)ret_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv); + C2Tuple_PaymentHashPaymentIdZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelConfig o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelConfig_clone(&o_conv); - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr); + o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelConfigDecodeErrorZ_free(_res_conv); + CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKOutPoint o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = OutPoint_clone(&o_conv); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKThirtyTwoBytes b_ref; + CHECK((*env)->GetArrayLength(env, b) == 32); + (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr); FREE((void*)_res); - CResult_OutPointDecodeErrorZ_free(_res_conv); + C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv); } -static inline uintptr_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); + o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKType o_conv = *(LDKType*)(o_ptr); - if (o_conv.free == LDKType_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKType_JCalls_cloned(&o_conv); - } - LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); - *ret_copy = COption_TypeZ_some(o_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); - *ret_copy = COption_TypeZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr); FREE((void*)_res); - COption_TypeZ_free(_res_conv); + CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv); } -static inline uintptr_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { - LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); - *ret_copy = COption_TypeZ_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; - int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; - LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); - *ret_copy = COption_TypeZ_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); - LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr); - o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uintptr_t)o) & ~1)); - LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); - *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv); + LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); + o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); - *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_COption_TypeZDecodeErrorZ_free(_res_conv); + CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); - *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); - LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); - *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_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_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); - *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref); + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr); - e_conv = PaymentError_clone((LDKPaymentError*)(((uintptr_t)e) & ~1)); - LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); - *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = CResult_PaymentSecretNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr); + LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentIdPaymentErrorZ_free(_res_conv); + CResult_PaymentSecretNoneZ_free(_res_conv); } -static inline uintptr_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); - *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg); +static inline uintptr_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) { + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = CResult_PaymentSecretNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1); - LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); - *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1); + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) { - LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_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_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); - LDKParseError e_conv = *(LDKParseError*)(e_ptr); - e_conv = ParseError_clone((LDKParseError*)(((uintptr_t)e) & ~1)); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)(o & ~1); - jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr); + LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SiPrefixParseErrorZ_free(_res_conv); + CResult_PaymentSecretAPIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg); +static inline uintptr_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)(orig & ~1); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoice o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Invoice_clone(&o_conv); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_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_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); - LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); - e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)(((uintptr_t)e) & ~1)); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(o & ~1); - jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr); + LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv); + CResult_PaymentPreimageAPIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg); +static inline uintptr_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(orig & ~1); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1); + LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKSignedRawInvoice o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCounterpartyForwardingInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = SignedRawInvoice_clone(&o_conv); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv); + o_conv = CounterpartyForwardingInfo_clone(&o_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKParseError e_conv = *(LDKParseError*)(e_ptr); - e_conv = ParseError_clone((LDKParseError*)(((uintptr_t)e) & ~1)); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(o & ~1); - jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SignedRawInvoiceParseErrorZ_free(_res_conv); + CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg); +static inline uintptr_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(orig & ~1); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1); - int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b, int64_t c) { - LDKRawInvoice a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = RawInvoice_clone(&a_conv); - LDKThirtyTwoBytes b_ref; - CHECK((*env)->GetArrayLength(env, b) == 32); - (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); - LDKInvoiceSignature c_conv; - c_conv.inner = (void*)(c & (~1)); - c_conv.is_owned = (c & 1) || (c == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = InvoiceSignature_clone(&c_conv); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr); - FREE((void*)_res); - C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKPayeePubKey o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelCounterparty o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PayeePubKey_clone(&o_conv); - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv); + o_conv = ChannelCounterparty_clone(&o_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr); + LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_PayeePubKeyErrorZ_free(_res_conv); + CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) { - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1); - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_PrivateRouteZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - LDKPrivateRoute _res_conv_14_conv; - _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); - _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_PrivateRouteZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKPositiveTimestamp o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelDetails o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PositiveTimestamp_clone(&o_conv); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); + o_conv = ChannelDetails_clone(&o_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKCreationError e_conv = LDKCreationError_from_java(env, e); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); + LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_PositiveTimestampCreationErrorZ_free(_res_conv); + CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKPhantomRouteHints o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PhantomRouteHints_clone(&o_conv); + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSemanticError e_conv = LDKSemanticError_from_java(env, e); - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr); + LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NoneSemanticErrorZ_free(_res_conv); + CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_clone(arg); +static inline uintptr_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1); - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoice o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Invoice_clone(&o_conv); - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(orig & ~1); + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSemanticError e_conv = LDKSemanticError_from_java(env, e); - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_ChannelMonitorZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t q = 0; q < _res_constr.datalen; q++) { + int64_t _res_conv_16 = _res_vals[q]; + LDKChannelMonitor _res_conv_16_conv; + _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); + _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); + _res_constr.data[q] = _res_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_ChannelMonitorZ_free(_res_constr); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1); - jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKChannelManager b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + // WARNING: we need a move here but no clone is available for LDKChannelManager + LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); + *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr); + LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr); FREE((void*)_res); - CResult_InvoiceSemanticErrorZ_free(_res_conv); + C2Tuple_BlockHashChannelManagerZ_free(_res_conv); } -static inline uintptr_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr); + // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1); - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKDescription o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelConfig o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Description_clone(&o_conv); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); + o_conv = ChannelConfig_clone(&o_conv); + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKCreationError e_conv = LDKCreationError_from_java(env, e); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1); - jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); + LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_DescriptionCreationErrorZ_free(_res_conv); + CResult_ChannelConfigDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKPrivateRoute o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PrivateRoute_clone(&o_conv); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); + o_conv = OutPoint_clone(&o_conv); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKCreationError e_conv = LDKCreationError_from_java(env, e); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); + LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_PrivateRouteCreationErrorZ_free(_res_conv); + CResult_OutPointDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); +static inline uintptr_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) { - LDKStr o_conv = java_to_owned_str(env, o); - LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); - *ret_conv = CResult_StringErrorZ_ok(o_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKType o_conv = *(LDKType*)(o_ptr); + if (o_conv.free == LDKType_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKType_JCalls_cloned(&o_conv); + } + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_some(o_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); - *ret_conv = CResult_StringErrorZ_err(e_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1); - jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); + LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr); FREE((void*)_res); - CResult_StringErrorZ_free(_res_conv); + COption_TypeZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelMonitorUpdate o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelMonitorUpdate_clone(&o_conv); - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); +static inline uintptr_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; + int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr); + o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uintptr_t)o) & ~1)); + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); + CResult_COption_TypeZDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); - o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)o) & ~1)); - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = COption_MonitorEventZ_some(o_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_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_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = COption_MonitorEventZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr); + e_conv = PaymentError_clone((LDKPaymentError*)(((uintptr_t)e) & ~1)); + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); + LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr); FREE((void*)_res); - COption_MonitorEventZ_free(_res_conv); + CResult_PaymentIdPaymentErrorZ_free(_res_conv); } -static inline uintptr_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = COption_MonitorEventZ_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; - int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = COption_MonitorEventZ_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1); + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); - o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uintptr_t)o) & ~1)); - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) { + LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKParseError e_conv = *(LDKParseError*)(e_ptr); + e_conv = ParseError_clone((LDKParseError*)(((uintptr_t)e) & ~1)); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)(o & ~1); + jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); + LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv); + CResult_SiPrefixParseErrorZ_free(_res_conv); } -static inline uintptr_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)(orig & ~1); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKHTLCUpdate o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HTLCUpdate_clone(&o_conv); - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); + o_conv = Invoice_clone(&o_conv); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); + e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)(((uintptr_t)e) & ~1)); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(o & ~1); + jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr); + LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_HTLCUpdateDecodeErrorZ_free(_res_conv); + CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv); } -static inline uintptr_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(orig & ~1); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) { - LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); - *ret_conv = C2Tuple_OutPointScriptZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKSignedRawInvoice o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = SignedRawInvoice_clone(&o_conv); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1); - LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); - *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKParseError e_conv = *(LDKParseError*)(e_ptr); + e_conv = ParseError_clone((LDKParseError*)(((uintptr_t)e) & ~1)); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - 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_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); - *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(o & ~1); + jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr); + LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_OutPointScriptZ_free(_res_conv); + CResult_SignedRawInvoiceParseErrorZ_free(_res_conv); } -static inline uintptr_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) { - LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); - *ret_conv = C2Tuple_u32ScriptZ_clone(arg); +static inline uintptr_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(orig & ~1); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +static inline uintptr_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg); return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1); + int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); - LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); - *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv); return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_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_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); - *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b, int64_t c) { + LDKRawInvoice a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = RawInvoice_clone(&a_conv); + LDKThirtyTwoBytes b_ref; + CHECK((*env)->GetArrayLength(env, b) == 32); + (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); + LDKInvoiceSignature c_conv; + c_conv.inner = (void*)(c & (~1)); + c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = InvoiceSignature_clone(&c_conv); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv); return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_u32ScriptZ_free(_res_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_u32ScriptZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t v = 0; v < _res_constr.datalen; v++) { - int64_t _res_conv_21 = _res_vals[v]; - void* _res_conv_21_ptr = (void*)(((uintptr_t)_res_conv_21) & ~1); - CHECK_ACCESS(_res_conv_21_ptr); - LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr); - FREE((void*)_res_conv_21); - _res_constr.data[v] = _res_conv_21_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_u32ScriptZZ_free(_res_constr); + C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv); } -static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKPayeePubKey o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PayeePubKey_clone(&o_conv); + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKCVec_C2Tuple_u32ScriptZZ b_constr; - b_constr.datalen = (*env)->GetArrayLength(env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); - else - b_constr.data = NULL; - int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); - for (size_t v = 0; v < b_constr.datalen; v++) { - int64_t b_conv_21 = b_vals[v]; - void* b_conv_21_ptr = (void*)(((uintptr_t)b_conv_21) & ~1); - CHECK_ACCESS(b_conv_21_ptr); - LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr); - b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uintptr_t)b_conv_21) & ~1)); - b_constr.data[v] = b_conv_21_conv; - } - (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr); + LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv); + CResult_PayeePubKeyErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr; +static inline uintptr_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1); + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_PrivateRouteZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_40 = _res_vals[o]; - void* _res_conv_40_ptr = (void*)(((uintptr_t)_res_conv_40) & ~1); - CHECK_ACCESS(_res_conv_40_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr); - FREE((void*)_res_conv_40); - _res_constr.data[o] = _res_conv_40_conv; + int64_t _res_conv_14 = _res_vals[o]; + LDKPrivateRoute _res_conv_14_conv; + _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); + _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr); + CVec_PrivateRouteZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_EventZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int64_t _res_conv_7 = _res_vals[h]; - void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); - CHECK_ACCESS(_res_conv_7_ptr); - LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr); - FREE((void*)_res_conv_7); - _res_constr.data[h] = _res_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_EventZ_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKPositiveTimestamp o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PositiveTimestamp_clone(&o_conv); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_TransactionZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ 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); - LDKTransaction _res_conv_8_ref; - _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8); - _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data); - _res_conv_8_ref.data_is_owned = true; - _res_constr.data[i] = _res_conv_8_ref; - } - CVec_TransactionZ_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKCreationError e_conv = LDKCreationError_from_java(env, e); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv); + return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { - LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); - *ret_conv = C2Tuple_u32TxOutZ_clone(arg); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_PositiveTimestampCreationErrorZ_free(_res_conv); +} + +static inline uintptr_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); - LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); - *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) { - void* b_ptr = (void*)(((uintptr_t)b) & ~1); - CHECK_ACCESS(b_ptr); - LDKTxOut b_conv = *(LDKTxOut*)(b_ptr); - b_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)b) & ~1)); - LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); - *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_ok(); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKSemanticError e_conv = LDKSemanticError_from_java(env, e); + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr); + LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_u32TxOutZ_free(_res_conv); + CResult_NoneSemanticErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_u32TxOutZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ 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]; - void* _res_conv_20_ptr = (void*)(((uintptr_t)_res_conv_20) & ~1); - CHECK_ACCESS(_res_conv_20_ptr); - LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr); - FREE((void*)_res_conv_20); - _res_constr.data[u] = _res_conv_20_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_u32TxOutZZ_free(_res_constr); +static inline uintptr_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; } -static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1); + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoice o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Invoice_clone(&o_conv); + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKSemanticError e_conv = LDKSemanticError_from_java(env, e); + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKCVec_C2Tuple_u32TxOutZZ b_constr; - b_constr.datalen = (*env)->GetArrayLength(env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); - else - b_constr.data = NULL; - int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); - for (size_t u = 0; u < b_constr.datalen; u++) { - int64_t b_conv_20 = b_vals[u]; - void* b_conv_20_ptr = (void*)(((uintptr_t)b_conv_20) & ~1); - CHECK_ACCESS(b_conv_20_ptr); - LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr); - b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uintptr_t)b_conv_20) & ~1)); - b_constr.data[u] = b_conv_20_conv; - } - (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1); + jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr); + LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv); + CResult_InvoiceSemanticErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ 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_39 = _res_vals[n]; - void* _res_conv_39_ptr = (void*)(((uintptr_t)_res_conv_39) & ~1); - CHECK_ACCESS(_res_conv_39_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr); - FREE((void*)_res_conv_39); - _res_constr.data[n] = _res_conv_39_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr); +static inline uintptr_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv); + return ret_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); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t j = 0; j < _res_constr.datalen; j++) { - int64_t _res_conv_9 = _res_vals[j]; - void* _res_conv_9_ptr = (void*)(((uintptr_t)_res_conv_9) & ~1); - CHECK_ACCESS(_res_conv_9_ptr); - LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr); - FREE((void*)_res_conv_9); - _res_constr.data[j] = _res_conv_9_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_BalanceZ_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1); + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr); - o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKDescription o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Description_clone(&o_conv); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKCreationError e_conv = LDKCreationError_from_java(env, e); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1); + jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr); + LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); + CResult_DescriptionCreationErrorZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = CResult_NoneLightningErrorZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKPrivateRoute o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PrivateRoute_clone(&o_conv); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKLightningError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = LightningError_clone(&e_conv); - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKCreationError e_conv = LDKCreationError_from_java(env, e); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr); + LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NoneLightningErrorZ_free(_res_conv); + CResult_PrivateRouteCreationErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = CResult_NoneLightningErrorZ_clone(arg); +static inline uintptr_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { - LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); - *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) { + LDKStr o_conv = java_to_owned_str(env, o); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); - LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); - *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_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); - void* b_ptr = (void*)(((uintptr_t)b) & ~1); - CHECK_ACCESS(b_ptr); - LDKType b_conv = *(LDKType*)(b_ptr); - if (b_conv.free == LDKType_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKType_JCalls_cloned(&b_conv); - } - LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); - *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1); + jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr); + LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_PublicKeyTypeZ_free(_res_conv); + CResult_StringErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t z = 0; z < _res_constr.datalen; z++) { - int64_t _res_conv_25 = _res_vals[z]; - void* _res_conv_25_ptr = (void*)(((uintptr_t)_res_conv_25) & ~1); - CHECK_ACCESS(_res_conv_25_ptr); - LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr); - FREE((void*)_res_conv_25); - _res_constr.data[z] = _res_conv_25_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); +static inline uintptr_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) { + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) { - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_ok(o); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)(orig & ~1); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKLightningError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelMonitorUpdate o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelMonitorUpdate_clone(&o_conv); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = LightningError_clone(&e_conv); - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_err(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1); - jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_boolLightningErrorZ_free(_res_conv); + CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); - *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); - int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); - *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { - LDKChannelAnnouncement a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = ChannelAnnouncement_clone(&a_conv); - LDKChannelUpdate b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = (b & 1) || (b == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = ChannelUpdate_clone(&b_conv); - LDKChannelUpdate c_conv; - c_conv.inner = (void*)(c & (~1)); - c_conv.is_owned = (c & 1) || (c == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = ChannelUpdate_clone(&c_conv); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); - *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr); - FREE((void*)_res); - C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int64_t _res_conv_59 = _res_vals[h]; - void* _res_conv_59_ptr = (void*)(((uintptr_t)_res_conv_59) & ~1); - CHECK_ACCESS(_res_conv_59_ptr); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr); - FREE((void*)_res_conv_59); - _res_constr.data[h] = _res_conv_59_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_NodeAnnouncementZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t s = 0; s < _res_constr.datalen; s++) { - int64_t _res_conv_18 = _res_vals[s]; - LDKNodeAnnouncement _res_conv_18_conv; - _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1)); - _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv); - _res_constr.data[s] = _res_conv_18_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_NodeAnnouncementZ_free(_res_constr); -} - -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_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); - LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); - o_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o) & ~1)); - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_some(o_conv); + LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); + o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)o) & ~1)); + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_some(o_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_none(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_none(); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr); + LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); FREE((void*)_res); - COption_NetAddressZ_free(_res_conv); + COption_MonitorEventZ_free(_res_conv); } -static inline uintptr_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) { - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_clone(arg); +static inline uintptr_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(arg); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)arg; - int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; + int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)orig; - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(orig_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(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); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); + o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uintptr_t)o) & ~1)); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKPeerHandleError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = PeerHandleError_clone(&e_conv); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1); - jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); + LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); + CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); +static inline uintptr_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHTLCUpdate o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HTLCUpdate_clone(&o_conv); + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKPeerHandleError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = PeerHandleError_clone(&e_conv); - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); + LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NonePeerHandleErrorZ_free(_res_conv); + CResult_HTLCUpdateDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); +static inline uintptr_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) { - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_ok(o); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKPeerHandleError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = PeerHandleError_clone(&e_conv); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1); + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1); - jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + 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_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); + LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr); FREE((void*)_res); - CResult_boolPeerHandleErrorZ_free(_res_conv); + C2Tuple_OutPointScriptZ_free(_res_conv); } -static inline uintptr_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_clone(arg); + return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeId o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeId_clone(&o_conv); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); + LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_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_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr); FREE((void*)_res); - CResult_NodeIdDecodeErrorZ_free(_res_conv); + C2Tuple_u32ScriptZ_free(_res_conv); } -static inline uintptr_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_u32ScriptZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t v = 0; v < _res_constr.datalen; v++) { + int64_t _res_conv_21 = _res_vals[v]; + void* _res_conv_21_ptr = (void*)(((uintptr_t)_res_conv_21) & ~1); + CHECK_ACCESS(_res_conv_21_ptr); + LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr); + FREE((void*)_res_conv_21); + _res_constr.data[v] = _res_conv_21_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_u32ScriptZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg); + return ((int64_t)ret_conv); } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); - o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uintptr_t)o) & ~1)); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1); + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKCVec_C2Tuple_u32ScriptZZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t v = 0; v < b_constr.datalen; v++) { + int64_t b_conv_21 = b_vals[v]; + void* b_conv_21_ptr = (void*)(((uintptr_t)b_conv_21) & ~1); + CHECK_ACCESS(b_conv_21_ptr); + LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr); + b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uintptr_t)b_conv_21) & ~1)); + b_constr.data[v] = b_conv_21_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr); FREE((void*)_res); - CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv); + C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv); } -static inline uintptr_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_40 = _res_vals[o]; + void* _res_conv_40_ptr = (void*)(((uintptr_t)_res_conv_40) & ~1); + CHECK_ACCESS(_res_conv_40_ptr); + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr); + FREE((void*)_res_conv_40); + _res_constr.data[o] = _res_conv_40_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_EventZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t h = 0; h < _res_constr.datalen; h++) { + int64_t _res_conv_7 = _res_vals[h]; + void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); + CHECK_ACCESS(_res_conv_7_ptr); + LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr); + FREE((void*)_res_conv_7); + _res_constr.data[h] = _res_conv_7_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_EventZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKAccess o_conv = *(LDKAccess*)(o_ptr); - if (o_conv.free == LDKAccess_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKAccess_JCalls_cloned(&o_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_TransactionZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ 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); + LDKTransaction _res_conv_8_ref; + _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8); + _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data); + _res_conv_8_ref.data_is_owned = true; + _res_constr.data[i] = _res_conv_8_ref; } - LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); - *ret_copy = COption_AccessZ_some(o_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; + CVec_TransactionZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); - *ret_copy = COption_AccessZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) { + void* b_ptr = (void*)(((uintptr_t)b) & ~1); + CHECK_ACCESS(b_ptr); + LDKTxOut b_conv = *(LDKTxOut*)(b_ptr); + b_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)b) & ~1)); + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr); + LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr); FREE((void*)_res); - COption_AccessZ_free(_res_conv); + C2Tuple_u32TxOutZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelUpdateInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelUpdateInfo_clone(&o_conv); - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_u32TxOutZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ 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]; + void* _res_conv_20_ptr = (void*)(((uintptr_t)_res_conv_20) & ~1); + CHECK_ACCESS(_res_conv_20_ptr); + LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr); + FREE((void*)_res_conv_20); + _res_constr.data[u] = _res_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_u32TxOutZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); + return ((int64_t)ret_conv); } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKCVec_C2Tuple_u32TxOutZZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t u = 0; u < b_constr.datalen; u++) { + int64_t b_conv_20 = b_vals[u]; + void* b_conv_20_ptr = (void*)(((uintptr_t)b_conv_20) & ~1); + CHECK_ACCESS(b_conv_20_ptr); + LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr); + b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uintptr_t)b_conv_20) & ~1)); + b_constr.data[u] = b_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr); + return ((int64_t)ret_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv); + C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ 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_39 = _res_vals[n]; + void* _res_conv_39_ptr = (void*)(((uintptr_t)_res_conv_39) & ~1); + CHECK_ACCESS(_res_conv_39_ptr); + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr); + FREE((void*)_res_conv_39); + _res_constr.data[n] = _res_conv_39_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_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); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t j = 0; j < _res_constr.datalen; j++) { + int64_t _res_conv_9 = _res_vals[j]; + void* _res_conv_9_ptr = (void*)(((uintptr_t)_res_conv_9) & ~1); + CHECK_ACCESS(_res_conv_9_ptr); + LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr); + FREE((void*)_res_conv_9); + _res_constr.data[j] = _res_conv_9_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_BalanceZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelInfo_clone(&o_conv); - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr); + o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr); + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelInfoDecodeErrorZ_free(_res_conv); + CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKRoutingFees o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = RoutingFees_clone(&o_conv); - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_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); + void* b_ptr = (void*)(((uintptr_t)b) & ~1); + CHECK_ACCESS(b_ptr); + LDKType b_conv = *(LDKType*)(b_ptr); + if (b_conv.free == LDKType_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKType_JCalls_cloned(&b_conv); + } + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr); FREE((void*)_res); - CResult_RoutingFeesDecodeErrorZ_free(_res_conv); -} - -static inline uintptr_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; + C2Tuple_PublicKeyTypeZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeAnnouncementInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeAnnouncementInfo_clone(&o_conv); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t z = 0; z < _res_constr.datalen; z++) { + int64_t _res_conv_25 = _res_vals[z]; + void* _res_conv_25_ptr = (void*)(((uintptr_t)_res_conv_25) & ~1); + CHECK_ACCESS(_res_conv_25_ptr); + LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr); + FREE((void*)_res_conv_25); + _res_constr.data[z] = _res_conv_25_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); + o_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o) & ~1)); + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_some(o_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr); + LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr); FREE((void*)_res); - CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); + COption_NetAddressZ_free(_res_conv); } -static inline uintptr_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; +static inline uintptr_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) { + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)arg; + int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_u64Z _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t g = 0; g < _res_constr.datalen; g++) { - int64_t _res_conv_6 = _res_vals[g]; - _res_constr.data[g] = _res_conv_6; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_u64Z_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)orig; + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeInfo_clone(&o_conv); - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(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); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); + e_conv = PeerHandleError_clone(&e_conv); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1); + jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr); + LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NodeInfoDecodeErrorZ_free(_res_conv); + CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNetworkGraph o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NetworkGraph_clone(&o_conv); - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_ok(); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); + e_conv = PeerHandleError_clone(&e_conv); + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr); + LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NetworkGraphDecodeErrorZ_free(_res_conv); + CResult_NonePeerHandleErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1); - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some(JNIEnv *env, jclass clz, int64_tArray o) { - LDKCVec_NetAddressZ o_constr; - o_constr.datalen = (*env)->GetArrayLength(env, o); - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); - else - o_constr.data = NULL; - int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - for (size_t m = 0; m < o_constr.datalen; m++) { - int64_t o_conv_12 = o_vals[m]; - void* o_conv_12_ptr = (void*)(((uintptr_t)o_conv_12) & ~1); - CHECK_ACCESS(o_conv_12_ptr); - LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr); - o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o_conv_12) & ~1)); - o_constr.data[m] = o_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); - LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); - *ret_copy = COption_CVec_NetAddressZZ_some(o_constr); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_ok(o); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); - *ret_copy = COption_CVec_NetAddressZZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKPeerHandleError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = PeerHandleError_clone(&e_conv); + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1); + jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr); + LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); - COption_CVec_NetAddressZZ_free(_res_conv); + CResult_boolPeerHandleErrorZ_free(_res_conv); } -static inline uintptr_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { - LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); - *ret_copy = COption_CVec_NetAddressZZ_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; - int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; - LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); - *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1ok(JNIEnv *env, jclass clz, int32_t o) { + LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ"); + *ret_conv = CResult_u32GraphSyncErrorZ_ok(o); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKGraphSyncError e_conv = *(LDKGraphSyncError*)(e_ptr); + e_conv = GraphSyncError_clone((LDKGraphSyncError*)(((uintptr_t)e) & ~1)); + LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ"); + *ret_conv = CResult_u32GraphSyncErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_u32GraphSyncErrorZ* o_conv = (LDKCResult_u32GraphSyncErrorZ*)(o & ~1); + jboolean ret_conv = CResult_u32GraphSyncErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_u32GraphSyncErrorZ _res_conv = *(LDKCResult_u32GraphSyncErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_u32GraphSyncErrorZ_free(_res_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -21579,58 +22040,58 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKFundingLocked o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelReady o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = FundingLocked_clone(&o_conv); - LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv); + o_conv = ChannelReady_clone(&o_conv); + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv); + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_FundingLockedDecodeErrorZ* o_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_FundingLockedDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_FundingLockedDecodeErrorZ_free(_res_conv); + CResult_ChannelReadyDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1); - LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } @@ -23162,6 +23623,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous return ret_ref; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)obj; + LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = PaymentPurpose_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); @@ -23297,21 +23777,38 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, j return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) { LDKThirtyTwoBytes temporary_channel_id_ref; CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); LDKCVec_u8Z output_script_ref; output_script_ref.datalen = (*env)->GetArrayLength(env, output_script); output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, channel_value_satoshis, output_script_ref, user_channel_id); + *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* purpose_ptr = (void*)(((uintptr_t)purpose) & ~1); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uintptr_t)purpose) & ~1)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amt, int64_t purpose) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) { LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -23320,7 +23817,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JN LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uintptr_t)purpose) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_received(payment_hash_ref, amt, purpose_conv); + *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -23345,6 +23842,49 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_tArray path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCVec_RouteHopZ path_constr; + path_constr.datalen = (*env)->GetArrayLength(env, path); + if (path_constr.datalen > 0) + path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + path_constr.data = NULL; + int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); + for (size_t k = 0; k < path_constr.datalen; k++) { + int64_t path_conv_10 = path_vals[k]; + LDKRouteHop path_conv_10_conv; + path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); + path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); + path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); + path_constr.data[k] = path_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, jboolean rejected_by_dest, int64_t network_update, jboolean all_paths_failed, int64_tArray path, int64_t short_channel_id, int64_t retry) { LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); @@ -23388,19 +23928,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) { LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); @@ -23431,13 +23958,19 @@ 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 fee_earned_msat, jboolean claim_from_onchain_tx) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(JNIEnv *env, jclass clz, int8_tArray prev_channel_id, int8_tArray next_channel_id, int64_t fee_earned_msat, jboolean claim_from_onchain_tx) { + LDKThirtyTwoBytes prev_channel_id_ref; + CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32); + (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data); + LDKThirtyTwoBytes next_channel_id_ref; + CHECK((*env)->GetArrayLength(env, next_channel_id) == 32); + (*env)->GetByteArrayRegion(env, next_channel_id, 0, 32, next_channel_id_ref.data); void* fee_earned_msat_ptr = (void*)(((uintptr_t)fee_earned_msat) & ~1); CHECK_ACCESS(fee_earned_msat_ptr); LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr); fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)fee_earned_msat) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_forwarded(fee_earned_msat_conv, claim_from_onchain_tx); + *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -23471,36 +24004,6 @@ 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_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_tArray path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = (*env)->GetArrayLength(env, path); - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); - for (size_t k = 0; k < path_constr.datalen; k++) { - int64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); - path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1request(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_t channel_type) { LDKThirtyTwoBytes temporary_channel_id_ref; CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); @@ -23627,17 +24130,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1locked(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { LDKPublicKey node_id_ref; CHECK((*env)->GetArrayLength(env, node_id) == 33); (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKFundingLocked msg_conv; + LDKChannelReady msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingLocked_clone(&msg_conv); + msg_conv = ChannelReady_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv); + *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -23862,335 +24365,2113 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1gos return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); - FREE((void*)this_ptr); - MessageSendEventsProvider_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); + FREE((void*)this_ptr); + MessageSendEventsProvider_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); + FREE((void*)this_ptr); + EventsProvider_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); + FREE((void*)this_ptr); + EventHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); + FREE((void*)this_ptr); + APIError_free(this_ptr_conv); +} + +static inline uintptr_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)arg; + int64_t ret_conv = APIError_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAPIError* orig_conv = (LDKAPIError*)orig; + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_apimisuse_error(err_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_route_error(err_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_channel_unavailable(err_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed(JNIEnv *env, jclass clz) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_monitor_update_failed(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script(JNIEnv *env, jclass clz, int64_t script) { + LDKShutdownScript script_conv; + script_conv.inner = (void*)(script & (~1)); + script_conv.is_owned = (script & 1) || (script == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); + script_conv = ShutdownScript_clone(&script_conv); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_incompatible_shutdown_script(script_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBigSize this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BigSize_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBigSize this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = BigSize_get_a(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBigSize this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + BigSize_set_a(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1new(JNIEnv *env, jclass clz, int64_t a_arg) { + LDKBigSize ret_var = BigSize_new(a_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) { + LDKu8slice msg_ref; + msg_ref.datalen = (*env)->GetArrayLength(env, msg); + msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); + unsigned char sk_arr[32]; + CHECK((*env)->GetArrayLength(env, sk) == 32); + (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr); + unsigned char (*sk_ref)[32] = &sk_arr; + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = sign(msg_ref, sk_ref); + (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) { + LDKu8slice msg_ref; + msg_ref.datalen = (*env)->GetArrayLength(env, msg); + msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); + LDKStr sig_conv = java_to_owned_str(env, sig); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = recover_pk(msg_ref, sig_conv); + (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig, int8_tArray pk) { + LDKu8slice msg_ref; + msg_ref.datalen = (*env)->GetArrayLength(env, msg); + msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); + LDKStr sig_conv = java_to_owned_str(env, sig); + LDKPublicKey pk_ref; + CHECK((*env)->GetArrayLength(env, pk) == 33); + (*env)->GetByteArrayRegion(env, pk, 0, 33, pk_ref.compressed_form); + jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); + (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) { + LDKu8slice hrp_bytes_ref; + hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); + hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); + LDKCVec_u5Z data_without_signature_constr; + data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature); + if (data_without_signature_constr.datalen > 0) + data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); + else + data_without_signature_constr.data = NULL; + int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL); + for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { + int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; + + data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 }; + } + (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0); + LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); + FREE((void*)this_ptr); + Persister_free(this_ptr_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKLevel* orig_conv = (LDKLevel*)(orig & ~1); + jclass ret_conv = LDKLevel_to_java(env, Level_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_gossip()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_trace()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_debug()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_info()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_warn()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_error()); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKLevel* a_conv = (LDKLevel*)(a & ~1); + LDKLevel* b_conv = (LDKLevel*)(b & ~1); + jboolean ret_conv = Level_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Level_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKLevel* o_conv = (LDKLevel*)(o & ~1); + int64_t ret_conv = Level_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_max()); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRecord this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Record_free(this_obj_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv)); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKLevel val_conv = LDKLevel_from_java(env, val); + Record_set_level(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_args(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_args(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_module_path(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_module_path(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_file(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_file(&this_ptr_conv, val_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = Record_get_line(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + Record_set_line(&this_ptr_conv, val); +} + +static inline uintptr_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRecord arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = Record_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecord orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKRecord ret_var = Record_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); + FREE((void*)this_ptr); + Logger_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelHandshakeConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelHandshakeConfig_free(this_obj_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1max_1inbound_1htlc_1value_1in_1flight_1percent_1of_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1max_1inbound_1htlc_1value_1in_1flight_1percent_1of_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelHandshakeConfig orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelHandshakeLimits this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelHandshakeLimits_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv *env, jclass clz, int64_t min_funding_satoshis_arg, int64_t max_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean trust_own_funding_0conf_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeLimits arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelHandshakeLimits orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelConfig_free(this_obj_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelConfig_get_announced_channel(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_announced_channel(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { + LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelConfig orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) { + LDKChannelConfig ret_var = ChannelConfig_default(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelConfig obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelConfig_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_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = ChannelConfig_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUserConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UserConfig_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelHandshakeConfig val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelHandshakeConfig_clone(&val_conv); + UserConfig_set_own_channel_config(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelHandshakeLimits val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelHandshakeLimits_clone(&val_conv); + UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelConfig val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelConfig_clone(&val_conv); + UserConfig_set_channel_options(&this_ptr_conv, val_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UserConfig_set_accept_inbound_channels(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg) { + LDKChannelHandshakeConfig own_channel_config_arg_conv; + own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); + own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv); + own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv); + LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv; + peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1)); + peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv); + peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv); + LDKChannelConfig channel_options_arg_conv; + channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); + channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); + channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); + LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUserConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = UserConfig_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUserConfig orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKUserConfig ret_var = UserConfig_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) { + LDKUserConfig ret_var = UserConfig_default(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBestBlock this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BestBlock_free(this_obj_conv); +} + +static inline uintptr_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBestBlock arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = BestBlock_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBestBlock orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKBestBlock ret_var = BestBlock_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) { + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + LDKBestBlock ret_var = BestBlock_from_genesis(network_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) { + LDKThirtyTwoBytes block_hash_ref; + CHECK((*env)->GetArrayLength(env, block_hash) == 32); + (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data); + LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBestBlock this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data); + return ret_arr; +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBestBlock this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int32_t ret_conv = BestBlock_height(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAccessError* orig_conv = (LDKAccessError*)(orig & ~1); + jclass ret_conv = LDKAccessError_to_java(env, AccessError_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1chain(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_chain()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1tx(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_tx()); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr); + FREE((void*)this_ptr); + Access_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); + FREE((void*)this_ptr); + Listen_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); + FREE((void*)this_ptr); + Confirm_free(this_ptr_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)(orig & ~1); + jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_temporary_failure()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_permanent_failure()); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); + FREE((void*)this_ptr); + Watch_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); + FREE((void*)this_ptr); + Filter_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKWatchedOutput this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + WatchedOutput_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + WatchedOutput_set_block_hash(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&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); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv *env, jclass clz, int8_tArray block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) { + LDKThirtyTwoBytes block_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, block_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, block_hash_arg, 0, 32, block_hash_arg_ref.data); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); + outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKCVec_u8Z script_pubkey_arg_ref; + script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg); + script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data); + LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKWatchedOutput arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKWatchedOutput orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKWatchedOutput o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + int64_t ret_conv = WatchedOutput_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); + FREE((void*)this_ptr); + BroadcasterInterface_free(this_ptr_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)(orig & ~1); + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority()); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)(a & ~1); + LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)(b & ~1); + jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); + FREE((void*)this_ptr); + FeeEstimator_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMonitorUpdateId this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MonitorUpdateId_free(this_obj_conv); +} + +static inline uintptr_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { + LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorUpdateId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMonitorUpdateId orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKMonitorUpdateId o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + int64_t ret_conv = MonitorUpdateId_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKMonitorUpdateId a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKMonitorUpdateId b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); + FREE((void*)this_ptr); + Persist_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKLockedChannelMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + LockedChannelMonitor_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChainMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChainMonitor_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *env, jclass clz, int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) { + void* chain_source_ptr = (void*)(((uintptr_t)chain_source) & ~1); + CHECK_ACCESS(chain_source_ptr); + LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (chain_source_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&chain_source_conv.some); + } + } + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* feeest_ptr = (void*)(((uintptr_t)feeest) & ~1); + CHECK_ACCESS(feeest_ptr); + LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); + if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&feeest_conv); + } + void* persister_ptr = (void*)(((uintptr_t)persister) & ~1); + CHECK_ACCESS(persister_ptr); + LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); + if (persister_conv.free == LDKPersist_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKPersist_JCalls_cloned(&persister_conv); + } + LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray ignored_channels) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_ChannelDetailsZ ignored_channels_constr; + ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels); + if (ignored_channels_constr.datalen > 0) + ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + ignored_channels_constr.data = NULL; + int64_t* ignored_channels_vals = (*env)->GetLongArrayElements (env, ignored_channels, NULL); + for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { + int64_t ignored_channels_conv_16 = ignored_channels_vals[q]; + LDKChannelDetails ignored_channels_conv_16_conv; + ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1)); + ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); + ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); + ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0); + LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); + 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 j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + int64_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; + ret_arr_ptr[j] = ret_conv_9_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_ChainMonitor_1get_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = (void*)(funding_txo & (~1)); + funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&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 k = 0; k < ret_var.datalen; k++) { + LDKOutPoint ret_conv_10_var = ret_var.data[k]; + int64_t ret_conv_10_ref = 0; + CHECK((((uintptr_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); + ret_conv_10_ref = (uintptr_t)ret_conv_10_var.inner; + if (ret_conv_10_var.is_owned) { + ret_conv_10_ref |= 1; + } + ret_arr_ptr[k] = ret_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = (void*)(funding_txo & (~1)); + funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKMonitorUpdateId completed_update_id_conv; + completed_update_id_conv.inner = (void*)(completed_update_id & (~1)); + completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); + completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); + *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelMonitorUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelMonitorUpdate_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelMonitorUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelMonitorUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); +} + +static inline uintptr_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitorUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelMonitorUpdate orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); - FREE((void*)this_ptr); - EventsProvider_free(this_ptr_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelMonitorUpdate obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); - FREE((void*)this_ptr); - EventHandler_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_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_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = ChannelMonitorUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); + LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); FREE((void*)this_ptr); - APIError_free(this_ptr_conv); + MonitorEvent_free(this_ptr_conv); } -static inline uintptr_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(arg); +static inline uintptr_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAPIError* arg_conv = (LDKAPIError*)arg; - int64_t ret_conv = APIError_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; + int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAPIError* orig_conv = (LDKAPIError*)orig; - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_apimisuse_error(err_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(orig_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_route_error(err_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) { + LDKHTLCUpdate a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = HTLCUpdate_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_htlcevent(a_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_channel_unavailable(err_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz, int64_t a) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed(JNIEnv *env, jclass clz) { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_monitor_update_failed(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) { + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = (void*)(funding_txo & (~1)); + funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script(JNIEnv *env, jclass clz, int64_t script) { - LDKShutdownScript script_conv; - script_conv.inner = (void*)(script & (~1)); - script_conv.is_owned = (script & 1) || (script == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); - script_conv = ShutdownScript_clone(&script_conv); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_incompatible_shutdown_script(script_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_update_failed(a_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) { - LDKu8slice msg_ref; - msg_ref.datalen = (*env)->GetArrayLength(env, msg); - msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); - unsigned char sk_arr[32]; - CHECK((*env)->GetArrayLength(env, sk) == 32); - (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr); - unsigned char (*sk_ref)[32] = &sk_arr; - LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); - *ret_conv = sign(msg_ref, sk_ref); - (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) { - LDKu8slice msg_ref; - msg_ref.datalen = (*env)->GetArrayLength(env, msg); - msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); - LDKStr sig_conv = java_to_owned_str(env, sig); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = recover_pk(msg_ref, sig_conv); - (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig, int8_tArray pk) { - LDKu8slice msg_ref; - msg_ref.datalen = (*env)->GetArrayLength(env, msg); - msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); - LDKStr sig_conv = java_to_owned_str(env, sig); - LDKPublicKey pk_ref; - CHECK((*env)->GetArrayLength(env, pk) == 33); - (*env)->GetByteArrayRegion(env, pk, 0, 33, pk_ref.compressed_form); - jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); - (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) { - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); - hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); - LDKCVec_u5Z data_without_signature_constr; - data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature); - if (data_without_signature_constr.datalen > 0) - data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); - else - data_without_signature_constr.data = NULL; - int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL); - for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { - int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; - - data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 }; - } - (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0); - LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj; + LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); - (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0); return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKLevel* orig_conv = (LDKLevel*)(orig & ~1); - jclass ret_conv = LDKLevel_to_java(env, Level_clone(orig_conv)); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_gossip()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_trace()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_debug()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_info()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_warn()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_error()); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKLevel* a_conv = (LDKLevel*)(a & ~1); - LDKLevel* b_conv = (LDKLevel*)(b & ~1); - jboolean ret_conv = Level_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Level_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKLevel* o_conv = (LDKLevel*)(o & ~1); - int64_t ret_conv = Level_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_max()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRecord this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHTLCUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Record_free(this_obj_conv); -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv)); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKLevel val_conv = LDKLevel_from_java(env, val); - Record_set_level(&this_ptr_conv, val_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = Record_get_args(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - Record_set_args(&this_ptr_conv, val_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = Record_get_module_path(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - Record_set_module_path(&this_ptr_conv, val_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = Record_get_file(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - Record_set_file(&this_ptr_conv, val_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = Record_get_line(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - Record_set_line(&this_ptr_conv, val); + HTLCUpdate_free(this_obj_conv); } -static inline uintptr_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { - LDKRecord ret_var = Record_clone(arg); +static inline uintptr_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24201,21 +26482,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRecord arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Record_clone_ptr(&arg_conv); + int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRecord orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKRecord ret_var = Record_clone(&orig_conv); + LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24227,106 +26508,102 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHTLCUpdate obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_HTLCUpdate_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_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = HTLCUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); + LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); FREE((void*)this_ptr); - Logger_free(this_ptr_conv); + Balance_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelHandshakeConfig this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelHandshakeConfig_free(this_obj_conv); +static inline uintptr_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBalance* arg_conv = (LDKBalance*)arg; + int64_t ret_conv = Balance_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBalance* orig_conv = (LDKBalance*)orig; + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t confirmation_height) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1contentious_1claimable(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t timeout_height) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1claimable_1htlcawaiting_1timeout(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t claimable_height) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Balance_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBalance* a_conv = (LDKBalance*)a; + LDKBalance* b_conv = (LDKBalance*)b; + jboolean ret_conv = Balance_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, jboolean negotiate_scid_privacy_arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, negotiate_scid_privacy_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelMonitor_free(this_obj_conv); } -static inline uintptr_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); +static inline uintptr_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24337,21 +26614,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelHandshakeConfig arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelHandshakeConfig orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelMonitor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); + LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24363,165 +26640,504 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clo return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelMonitor obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelHandshakeLimits this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelHandshakeLimits_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelMonitorUpdate updates_conv; + updates_conv.inner = (void*)(updates & (~1)); + updates_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); + return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&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 o = 0; o < ret_var.datalen; o++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv_40_conv = ret_var.data[o]; + ret_arr_ptr[o] = ((int64_t)ret_conv_40_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t filter) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* filter_ptr = (void*)(((uintptr_t)filter) & ~1); + if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } + LDKFilter* filter_conv = (LDKFilter*)filter_ptr; + ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&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 o = 0; o < ret_var.datalen; o++) { + LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_conv_14_copy = ret_var.data[o]; + int64_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; + ret_arr_ptr[o] = ret_conv_14_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&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 h = 0; h < ret_var.datalen; h++) { + LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_conv_7_copy = ret_var.data[h]; + int64_t ret_conv_7_ref = (uintptr_t)ret_conv_7_copy; + ret_arr_ptr[h] = ret_conv_7_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_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); - return ret_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKTransaction ret_conv_8_var = ret_var.data[i]; + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data); + Transaction_free(ret_conv_8_var); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t n = 0; n < ret_var.datalen; n++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_39_conv = ret_var.data[n]; + ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t n = 0; n < ret_var.datalen; n++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_39_conv = ret_var.data[n]; + ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char txid_arr[32]; + CHECK((*env)->GetArrayLength(env, txid) == 32); + (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); + unsigned char (*txid_ref)[32] = &txid_arr; + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t n = 0; n < ret_var.datalen; n++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_39_conv = ret_var.data[n]; + ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&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 j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + int64_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; + ret_arr_ptr[j] = ret_conv_9_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr; + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOutPoint this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OutPoint_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelHandshakeLimits this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + OutPoint_set_txid(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); + int16_t ret_conv = OutPoint_get_index(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); + OutPoint_set_index(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv *env, jclass clz, int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) { + LDKThirtyTwoBytes txid_arg_ref; + CHECK((*env)->GetArrayLength(env, txid_arg) == 32); + (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data); + LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24533,8 +27149,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new return ret_ref; } -static inline uintptr_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +static inline uintptr_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24545,21 +27161,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelHandshakeLimits arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOutPoint arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv); + int64_t ret_conv = OutPoint_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelHandshakeLimits orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOutPoint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); + LDKOutPoint ret_var = OutPoint_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24571,148 +27187,227 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clo return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKOutPoint b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelConfig this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKOutPoint o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + int64_t ret_conv = OutPoint_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOutPoint this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOutPoint obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_OutPoint_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = OutPoint_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelConfig_free(this_obj_conv); + DelayedPaymentOutputDescriptor_free(this_obj_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); + int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelConfig_get_announced_channel(&this_ptr_conv); - return ret_conv; + DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_announced_channel(&this_ptr_conv, val); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); + DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); + DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { - LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int8_tArray revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); + outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKPublicKey per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); + void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); + LDKPublicKey revocation_pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, revocation_pubkey_arg, 0, 33, revocation_pubkey_arg_ref.compressed_form); + LDKThirtyTwoBytes channel_keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24724,8 +27419,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * return ret_ref; } -static inline uintptr_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { - LDKChannelConfig ret_var = ChannelConfig_clone(arg); +static inline uintptr_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24736,34 +27431,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelConfig arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv); + int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelConfig orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) { - LDKChannelConfig ret_var = ChannelConfig_default(); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24775,102 +27457,42 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIE return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelConfig obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); + LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = ChannelConfig_read(ser_ref); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUserConfig this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UserConfig_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelHandshakeConfig val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelHandshakeConfig_clone(&val_conv); - UserConfig_set_own_channel_config(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelHandshakeLimits val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelHandshakeLimits_clone(&val_conv); - UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv); + StaticPaymentOutputDescriptor_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); + LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24882,87 +27504,83 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1o return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelConfig val_conv; + LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelConfig_clone(&val_conv); - UserConfig_set_channel_options(&this_ptr_conv, val_conv); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); - return ret_conv; + val_conv = OutPoint_clone(&val_conv); + StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); + StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UserConfig_set_accept_inbound_channels(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg) { - LDKChannelHandshakeConfig own_channel_config_arg_conv; - own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); - own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv); - own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv); - LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv; - peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1)); - peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv); - peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv); - LDKChannelConfig channel_options_arg_conv; - channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); - channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); - channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); - LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); + outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); + LDKThirtyTwoBytes channel_keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24974,8 +27592,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env return ret_ref; } -static inline uintptr_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { - LDKUserConfig ret_var = UserConfig_clone(arg); +static inline uintptr_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24986,21 +27604,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUserConfig arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UserConfig_clone_ptr(&arg_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUserConfig orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUserConfig ret_var = UserConfig_clone(&orig_conv); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25012,287 +27630,396 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *e return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) { - LDKUserConfig ret_var = UserConfig_default(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKStaticPaymentOutputDescriptor obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBestBlock this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BestBlock_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -static inline uintptr_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { - LDKBestBlock ret_var = BestBlock_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + FREE((void*)this_ptr); + SpendableOutputDescriptor_free(this_ptr_conv); } + +static inline uintptr_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBestBlock arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = BestBlock_clone_ptr(&arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; + int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBestBlock orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKBestBlock ret_var = BestBlock_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) { - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - LDKBestBlock ret_var = BestBlock_from_genesis(network_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = (void*)(outpoint & (~1)); + outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + void* output_ptr = (void*)(((uintptr_t)output) & ~1); + CHECK_ACCESS(output_ptr); + LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); + output_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output) & ~1)); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) { - LDKThirtyTwoBytes block_hash_ref; - CHECK((*env)->GetArrayLength(env, block_hash) == 32); - (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data); - LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { + LDKDelayedPaymentOutputDescriptor a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data); - return ret_arr; -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int32_t ret_conv = BestBlock_height(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAccessError* orig_conv = (LDKAccessError*)(orig & ~1); - jclass ret_conv = LDKAccessError_to_java(env, AccessError_clone(orig_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { + LDKStaticPaymentOutputDescriptor a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1chain(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_chain()); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj; + LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1tx(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_tx()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = SpendableOutputDescriptor_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr); + LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr); FREE((void*)this_ptr); - Access_free(this_ptr_conv); + BaseSign_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); - FREE((void*)this_ptr); - Listen_free(this_ptr_conv); +static inline uintptr_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = Sign_clone(arg); + return (int64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSign* arg_conv = (LDKSign*)arg_ptr; + int64_t ret_conv = Sign_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); + if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } + LDKSign* orig_conv = (LDKSign*)orig_ptr; + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = Sign_clone(orig_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); + LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr); FREE((void*)this_ptr); - Confirm_free(this_ptr_conv); + Sign_free(this_ptr_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)(orig & ~1); - jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_clone(orig_conv)); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecipient* orig_conv = (LDKRecipient*)(orig & ~1); + jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv)); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_temporary_failure()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRecipient_to_java(env, Recipient_node()); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_permanent_failure()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node()); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); - FREE((void*)this_ptr); - Watch_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); + LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr); FREE((void*)this_ptr); - Filter_free(this_ptr_conv); + KeysInterface_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKWatchedOutput this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInMemorySigner this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - WatchedOutput_free(this_obj_conv); + InMemorySigner_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; + LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - WatchedOutput_set_block_hash(&this_ptr_conv, val_ref); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&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); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv *env, jclass clz, int8_tArray block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) { - LDKThirtyTwoBytes block_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, block_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, block_hash_arg, 0, 32, block_hash_arg_ref.data); - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); - outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKCVec_u8Z script_pubkey_arg_ref; - script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg); - script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data); - LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); +} + +static inline uintptr_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInMemorySigner arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInMemorySigner orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray node_secret, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) { + LDKSecretKey node_secret_ref; + CHECK((*env)->GetArrayLength(env, node_secret) == 32); + (*env)->GetByteArrayRegion(env, node_secret, 0, 32, node_secret_ref.bytes); + LDKSecretKey funding_key_ref; + CHECK((*env)->GetArrayLength(env, funding_key) == 32); + (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes); + LDKSecretKey revocation_base_key_ref; + CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32); + (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes); + LDKSecretKey payment_key_ref; + CHECK((*env)->GetArrayLength(env, payment_key) == 32); + (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes); + LDKSecretKey delayed_payment_base_key_ref; + CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32); + (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes); + LDKSecretKey htlc_base_key_ref; + CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); + (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes); + LDKThirtyTwoBytes commitment_seed_ref; + CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); + (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); + LDKInMemorySigner ret_var = InMemorySigner_new(node_secret_ref, funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25304,33 +28031,39 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * return ret_ref; } -static inline uintptr_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { - LDKWatchedOutput ret_var = WatchedOutput_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); + return ret_conv; } - return ret_ref; + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKWatchedOutput arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKWatchedOutput orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25342,96 +28075,129 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKWatchedOutput o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = WatchedOutput_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); - FREE((void*)this_ptr); - BroadcasterInterface_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv); + return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)(orig & ~1); - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_clone(orig_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); + spend_tx_ref.data_is_owned = true; + LDKStaticPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = (void*)(descriptor & (~1)); + descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return (int64_t)ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); + spend_tx_ref.data_is_owned = true; + LDKDelayedPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = (void*)(descriptor & (~1)); + descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return (int64_t)ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); + *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)(a & ~1); - LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)(b & ~1); - jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInMemorySigner obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); - FREE((void*)this_ptr); - FeeEstimator_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int8_tArray arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKSecretKey arg_ref; + CHECK((*env)->GetArrayLength(env, arg) == 32); + (*env)->GetByteArrayRegion(env, arg, 0, 32, arg_ref.bytes); + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = InMemorySigner_read(ser_ref, arg_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMonitorUpdateId this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKKeysManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MonitorUpdateId_free(this_obj_conv); -} - -static inline uintptr_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKMonitorUpdateId arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); - return ret_conv; + KeysManager_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKMonitorUpdateId orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { + unsigned char seed_arr[32]; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); + unsigned char (*seed_ref)[32] = &seed_arr; + LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25443,94 +28209,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIE return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKMonitorUpdateId o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = MonitorUpdateId_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKMonitorUpdateId a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKMonitorUpdateId b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); - FREE((void*)this_ptr); - Persist_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKLockedChannelMonitor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - LockedChannelMonitor_free(this_obj_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChainMonitor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChainMonitor_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *env, jclass clz, int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) { - void* chain_source_ptr = (void*)(((uintptr_t)chain_source) & ~1); - CHECK_ACCESS(chain_source_ptr); - LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (chain_source_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&chain_source_conv.some); - } - } - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* feeest_ptr = (void*)(((uintptr_t)feeest) & ~1); - CHECK_ACCESS(feeest_ptr); - LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); - if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&feeest_conv); - } - void* persister_ptr = (void*)(((uintptr_t)persister) & ~1); - CHECK_ACCESS(persister_ptr); - LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); - if (persister_conv.free == LDKPersist_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKPersist_JCalls_cloned(&persister_conv); - } - LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char params_arr[32]; + CHECK((*env)->GetArrayLength(env, params) == 32); + (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); + unsigned char (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25542,171 +28230,253 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray ignored_channels) { - LDKChainMonitor this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) { + LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_ChannelDetailsZ ignored_channels_constr; - ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels); - if (ignored_channels_constr.datalen > 0) - ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else - ignored_channels_constr.data = NULL; - int64_t* ignored_channels_vals = (*env)->GetLongArrayElements (env, ignored_channels, NULL); - for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { - int64_t ignored_channels_conv_16 = ignored_channels_vals[q]; - LDKChannelDetails ignored_channels_conv_16_conv; - ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1)); - ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); - ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); - ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; + descriptors_constr.data = NULL; + int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); + descriptors_constr.data[b] = descriptors_conv_27_conv; } - (*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0); - LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); - 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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - int64_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; - ret_arr_ptr[j] = ret_conv_9_ref; + (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); + LDKCVec_TxOutZ outputs_constr; + outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + outputs_constr.data = NULL; + int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); + for (size_t h = 0; h < outputs_constr.datalen; h++) { + int64_t outputs_conv_7 = outputs_vals[h]; + void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); + CHECK_ACCESS(outputs_conv_7_ptr); + LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); + outputs_constr.data[h] = outputs_conv_7_conv; } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); + LDKCVec_u8Z change_destination_script_ref; + change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); + change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo) { - LDKChainMonitor this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = (void*)(funding_txo & (~1)); - funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); - return (int64_t)ret_conv; + LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); + *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPhantomKeysManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PhantomKeysManager_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&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 k = 0; k < ret_var.datalen; k++) { - LDKOutPoint ret_conv_10_var = ret_var.data[k]; - int64_t ret_conv_10_ref = 0; - CHECK((((uintptr_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); - ret_conv_10_ref = (uintptr_t)ret_conv_10_var.inner; - if (ret_conv_10_var.is_owned) { - ret_conv_10_ref |= 1; - } - ret_arr_ptr[k] = ret_conv_10_ref; + LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); + *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { + unsigned char seed_arr[32]; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); + unsigned char (*seed_ref)[32] = &seed_arr; + unsigned char cross_node_seed_arr[32]; + CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32); + (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr); + unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr; + LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) { - LDKChainMonitor this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = (void*)(funding_txo & (~1)); - funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorUpdateId completed_update_id_conv; - completed_update_id_conv.inner = (void*)(completed_update_id & (~1)); - completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); - completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + descriptors_constr.data = NULL; + int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); + descriptors_constr.data[b] = descriptors_conv_27_conv; + } + (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); + LDKCVec_TxOutZ outputs_constr; + outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + outputs_constr.data = NULL; + int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); + for (size_t h = 0; h < outputs_constr.datalen; h++) { + int64_t outputs_conv_7 = outputs_vals[h]; + void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); + CHECK_ACCESS(outputs_conv_7_ptr); + LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); + outputs_constr.data[h] = outputs_conv_7_conv; + } + (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); + LDKCVec_u8Z change_destination_script_ref; + change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); + change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); - *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); - return (int64_t)ret_ret; + unsigned char params_arr[32]; + CHECK((*env)->GetArrayLength(env, params) == 32); + (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); + unsigned char (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelManager_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelMonitorUpdate this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChainParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelMonitorUpdate_free(this_obj_conv); + ChainParameters_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1network(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); + jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv)); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelMonitorUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); + LDKNetwork val_conv = LDKNetwork_from_java(env, val); + ChainParameters_set_network(&this_ptr_conv, val_conv); } -static inline uintptr_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChainParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChainParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKBestBlock val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BestBlock_clone(&val_conv); + ChainParameters_set_best_block(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv *env, jclass clz, jclass network_arg, int64_t best_block_arg) { + LDKNetwork network_arg_conv = LDKNetwork_from_java(env, network_arg); + LDKBestBlock best_block_arg_conv; + best_block_arg_conv.inner = (void*)(best_block_arg & (~1)); + best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); + best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); + LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25717,21 +28487,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelMonitorUpdate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChainParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelMonitorUpdate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChainParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); + LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25743,134 +28513,80 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelMonitorUpdate obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyForwardingInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCounterpartyForwardingInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CounterpartyForwardingInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_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_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = ChannelMonitorUpdate_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); - FREE((void*)this_ptr); - MonitorEvent_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); } -static inline uintptr_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; - int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) { - LDKHTLCUpdate a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = HTLCUpdate_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_htlcevent(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz, int64_t a) { - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) { - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = (void*)(funding_txo & (~1)); - funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) { - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_update_failed(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj; - LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = MonitorEvent_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKHTLCUpdate this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCUpdate_free(this_obj_conv); -} - -static inline uintptr_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { - LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +static inline uintptr_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25881,21 +28597,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHTLCUpdate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyForwardingInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHTLCUpdate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCounterpartyForwardingInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25907,102 +28623,196 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *e return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHTLCUpdate obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelCounterparty_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelCounterparty this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelCounterparty_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_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_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = HTLCUpdate_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); - FREE((void*)this_ptr); - Balance_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); } -static inline uintptr_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBalance* arg_conv = (LDKBalance*)arg; - int64_t ret_conv = Balance_clone_ptr(arg_conv); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKInitFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InitFeatures_clone(&val_conv); + ChannelCounterparty_set_features(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBalance* orig_conv = (LDKBalance*)orig; - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis); - int64_t ret_ref = (uintptr_t)ret_copy; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t confirmation_height) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCounterpartyForwardingInfo val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CounterpartyForwardingInfo_clone(&val_conv); + ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1contentious_1claimable(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t timeout_height) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1claimable_1htlcawaiting_1timeout(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t claimable_height) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1outbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Balance_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBalance* a_conv = (LDKBalance*)a; - LDKBalance* b_conv = (LDKBalance*)b; - jboolean ret_conv = Balance_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1outbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelMonitor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelMonitor_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JNIEnv *env, jclass clz, int8_tArray node_id_arg, int64_t features_arg, int64_t unspendable_punishment_reserve_arg, int64_t forwarding_info_arg, int64_t outbound_htlc_minimum_msat_arg, int64_t outbound_htlc_maximum_msat_arg) { + LDKPublicKey node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); + LDKInitFeatures features_arg_conv; + features_arg_conv.inner = (void*)(features_arg & (~1)); + features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = InitFeatures_clone(&features_arg_conv); + LDKCounterpartyForwardingInfo forwarding_info_arg_conv; + forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1)); + forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); + forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); + void* outbound_htlc_minimum_msat_arg_ptr = (void*)(((uintptr_t)outbound_htlc_minimum_msat_arg) & ~1); + CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr); + outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)outbound_htlc_minimum_msat_arg) & ~1)); + void* outbound_htlc_maximum_msat_arg_ptr = (void*)(((uintptr_t)outbound_htlc_maximum_msat_arg) & ~1); + CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr); + outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)outbound_htlc_maximum_msat_arg) & ~1)); + LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv, outbound_htlc_minimum_msat_arg_conv, outbound_htlc_maximum_msat_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline uintptr_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { - LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +static inline uintptr_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -26013,21 +28823,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelMonitor arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelCounterparty arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelMonitor orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelCounterparty orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -26039,409 +28849,41 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEn return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelMonitor obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelMonitor_1update_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelMonitorUpdate updates_conv; - updates_conv.inner = (void*)(updates & (~1)); - updates_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); - *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&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 o = 0; o < ret_var.datalen; o++) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); - *ret_conv_40_conv = ret_var.data[o]; - ret_arr_ptr[o] = ((int64_t)ret_conv_40_conv); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t filter) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* filter_ptr = (void*)(((uintptr_t)filter) & ~1); - if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } - LDKFilter* filter_conv = (LDKFilter*)filter_ptr; - ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&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 o = 0; o < ret_var.datalen; o++) { - LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_conv_14_copy = ret_var.data[o]; - int64_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; - ret_arr_ptr[o] = ret_conv_14_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&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 h = 0; h < ret_var.datalen; h++) { - LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_conv_7_copy = ret_var.data[h]; - int64_t ret_conv_7_ref = (uintptr_t)ret_conv_7_copy; - ret_arr_ptr[h] = ret_conv_7_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - LDKTransaction ret_conv_8_var = ret_var.data[i]; - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data); - Transaction_free(ret_conv_8_var); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char txid_arr[32]; - CHECK((*env)->GetArrayLength(env, txid) == 32); - (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); - unsigned char (*txid_ref)[32] = &txid_arr; - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelDetails this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelDetails_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -26453,533 +28895,488 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1be return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - int64_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; - ret_arr_ptr[j] = ret_conv_9_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_C2Tuple_1BlockHashChannelMonitorZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); - if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } - LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr; - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelCounterparty val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelCounterparty_clone(&val_conv); + ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOutPoint this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OutPoint_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOutPoint this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv)); - return ret_arr; + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOutPoint this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - OutPoint_set_txid(&this_ptr_conv, val_ref); + LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } + return ret_ref; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOutPoint this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = OutPoint_get_index(&this_ptr_conv); - return ret_conv; + LDKChannelTypeFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTypeFeatures_clone(&val_conv); + ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKOutPoint this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OutPoint_set_index(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) { - LDKThirtyTwoBytes txid_arg_ref; - CHECK((*env)->GetArrayLength(env, txid_arg) == 32); - (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data); - LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static inline uintptr_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { - LDKOutPoint ret_var = OutPoint_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); } + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOutPoint arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = OutPoint_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOutPoint orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKOutPoint ret_var = OutPoint_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKOutPoint b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKOutPoint o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = OutPoint_hash(&o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOutPoint this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOutPoint obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = OutPoint_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDelayedPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DelayedPaymentOutputDescriptor_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); + ChannelDetails_set_user_channel_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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 = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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 = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); + ChannelDetails_set_balance_msat(&this_ptr_conv, val); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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 = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); + int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); + ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1next_1outbound_1htlc_1limit_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); - DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); + int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1next_1outbound_1htlc_1limit_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; + ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref); + int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); - return ret_arr; + ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int8_tArray revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); - outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKPublicKey per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); - void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); - LDKPublicKey revocation_pubkey_arg_ref; - CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33); - (*env)->GetByteArrayRegion(env, revocation_pubkey_arg, 0, 33, revocation_pubkey_arg_ref.compressed_form); - LDKThirtyTwoBytes channel_keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static inline uintptr_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDelayedPaymentOutputDescriptor arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDelayedPaymentOutputDescriptor orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelDetails_set_is_outbound(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKDelayedPaymentOutputDescriptor obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelDetails_set_is_channel_ready(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKStaticPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - StaticPaymentOutputDescriptor_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + ChannelDetails_set_is_usable(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); + jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); - StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); + ChannelDetails_set_is_public(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); - return ret_arr; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); - outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); - LDKThirtyTwoBytes channel_keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray 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, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, jboolean is_usable_arg, jboolean is_public_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKChannelCounterparty counterparty_arg_conv; + counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); + counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); + counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); + LDKOutPoint funding_txo_arg_conv; + funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1)); + funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); + funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); + LDKChannelTypeFeatures channel_type_arg_conv; + channel_type_arg_conv.inner = (void*)(channel_type_arg & (~1)); + channel_type_arg_conv.is_owned = (channel_type_arg & 1) || (channel_type_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); + channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); + void* short_channel_id_arg_ptr = (void*)(((uintptr_t)short_channel_id_arg) & ~1); + CHECK_ACCESS(short_channel_id_arg_ptr); + LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); + short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_arg) & ~1)); + void* outbound_scid_alias_arg_ptr = (void*)(((uintptr_t)outbound_scid_alias_arg) & ~1); + CHECK_ACCESS(outbound_scid_alias_arg_ptr); + LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr); + outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)outbound_scid_alias_arg) & ~1)); + void* inbound_scid_alias_arg_ptr = (void*)(((uintptr_t)inbound_scid_alias_arg) & ~1); + CHECK_ACCESS(inbound_scid_alias_arg_ptr); + LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr); + inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)inbound_scid_alias_arg) & ~1)); + void* unspendable_punishment_reserve_arg_ptr = (void*)(((uintptr_t)unspendable_punishment_reserve_arg) & ~1); + CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); + LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); + void* confirmations_required_arg_ptr = (void*)(((uintptr_t)confirmations_required_arg) & ~1); + CHECK_ACCESS(confirmations_required_arg_ptr); + LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr); + confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)confirmations_required_arg) & ~1)); + void* force_close_spend_delay_arg_ptr = (void*)(((uintptr_t)force_close_spend_delay_arg) & ~1); + CHECK_ACCESS(force_close_spend_delay_arg_ptr); + LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); + force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)force_close_spend_delay_arg) & ~1)); + void* inbound_htlc_minimum_msat_arg_ptr = (void*)(((uintptr_t)inbound_htlc_minimum_msat_arg) & ~1); + CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr); + inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)inbound_htlc_minimum_msat_arg) & ~1)); + void* inbound_htlc_maximum_msat_arg_ptr = (void*)(((uintptr_t)inbound_htlc_maximum_msat_arg) & ~1); + CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr); + inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)inbound_htlc_maximum_msat_arg) & ~1)); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, 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, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -26991,8 +29388,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript return ret_ref; } -static inline uintptr_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +static inline uintptr_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27003,21 +29400,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKStaticPaymentOutputDescriptor arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelDetails arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKStaticPaymentOutputDescriptor orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelDetails orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); + LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27029,317 +29426,276 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKStaticPaymentOutputDescriptor obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelDetails this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelDetails this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); FREE((void*)this_ptr); - SpendableOutputDescriptor_free(this_ptr_conv); + PaymentSendFailure_free(this_ptr_conv); } -static inline uintptr_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(arg); +static inline uintptr_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; - int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg; + int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(orig_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) { - LDKOutPoint outpoint_conv; - outpoint_conv.inner = (void*)(outpoint & (~1)); - outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - void* output_ptr = (void*)(((uintptr_t)output) & ~1); - CHECK_ACCESS(output_ptr); - LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); - output_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output) & ~1)); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = (void*)(((uintptr_t)a) & ~1); + CHECK_ACCESS(a_ptr); + LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); + a_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a) & ~1)); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_parameter_error(a_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { - LDKDelayedPaymentOutputDescriptor a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_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 = (void*)(((uintptr_t)a_conv_22) & ~1); + 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*)(((uintptr_t)a_conv_22) & ~1)); + 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 = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { - LDKStaticPaymentOutputDescriptor a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_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 = (void*)(((uintptr_t)a_conv_10) & ~1); + CHECK_ACCESS(a_conv_10_ptr); + LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); + a_conv_10_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a_conv_10) & ~1)); + 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_retry_safe(a_constr); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj; - LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = SpendableOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr); - FREE((void*)this_ptr); - BaseSign_free(this_ptr_conv); -} - -static inline uintptr_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { - LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); - *ret_ret = Sign_clone(arg); - return (int64_t)ret_ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); - if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } - LDKSign* arg_conv = (LDKSign*)arg_ptr; - int64_t ret_conv = Sign_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); - if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } - LDKSign* orig_conv = (LDKSign*)orig_ptr; - LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); - *ret_ret = Sign_clone(orig_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr); - FREE((void*)this_ptr); - Sign_free(this_ptr_conv); -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRecipient* orig_conv = (LDKRecipient*)(orig & ~1); - jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv)); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRecipient_to_java(env, Recipient_node()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node()); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr); - FREE((void*)this_ptr); - KeysInterface_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { + LDKCVec_CResult_NoneAPIErrorZZ results_constr; + results_constr.datalen = (*env)->GetArrayLength(env, results); + if (results_constr.datalen > 0) + results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + results_constr.data = NULL; + int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL); + for (size_t w = 0; w < results_constr.datalen; w++) { + int64_t results_conv_22 = results_vals[w]; + void* results_conv_22_ptr = (void*)(((uintptr_t)results_conv_22) & ~1); + CHECK_ACCESS(results_conv_22_ptr); + LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); + results_constr.data[w] = results_conv_22_conv; + } + (*env)->ReleaseLongArrayElements(env, results, results_vals, 0); + LDKRouteParameters failed_paths_retry_conv; + failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1)); + failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0); + 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 = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInMemorySigner this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPhantomRouteHints this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InMemorySigner_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); + PhantomRouteHints_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); + LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; + if (ret_conv_16_var.is_owned) { + ret_conv_16_ref |= 1; + } + ret_arr_ptr[q] = ret_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); + LDKCVec_ChannelDetailsZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t q = 0; q < val_constr.datalen; q++) { + int64_t val_conv_16 = val_vals[q]; + LDKChannelDetails val_conv_16_conv; + val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); + val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); + val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv); + val_constr.data[q] = val_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); - return ret_arr; + int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); + PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); - return ret_arr; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { + LDKCVec_ChannelDetailsZ channels_arg_constr; + channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg); + if (channels_arg_constr.datalen > 0) + channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + channels_arg_constr.data = NULL; + int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL); + for (size_t q = 0; q < channels_arg_constr.datalen; q++) { + int64_t channels_arg_conv_16 = channels_arg_vals[q]; + LDKChannelDetails channels_arg_conv_16_conv; + channels_arg_conv_16_conv.inner = (void*)(channels_arg_conv_16 & (~1)); + channels_arg_conv_16_conv.is_owned = (channels_arg_conv_16 & 1) || (channels_arg_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); + channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); + channels_arg_constr.data[q] = channels_arg_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0); + LDKPublicKey real_node_pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, real_node_pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, real_node_pubkey_arg, 0, 33, real_node_pubkey_arg_ref.compressed_form); + LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline uintptr_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { - LDKInMemorySigner ret_var = InMemorySigner_clone(arg); +static inline uintptr_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { + LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27350,21 +29706,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInMemorySigner arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPhantomRouteHints arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); + int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInMemorySigner orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPhantomRouteHints orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); + LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27376,32 +29732,53 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEn return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray node_secret, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) { - LDKSecretKey node_secret_ref; - CHECK((*env)->GetArrayLength(env, node_secret) == 32); - (*env)->GetByteArrayRegion(env, node_secret, 0, 32, node_secret_ref.bytes); - LDKSecretKey funding_key_ref; - CHECK((*env)->GetArrayLength(env, funding_key) == 32); - (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes); - LDKSecretKey revocation_base_key_ref; - CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32); - (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes); - LDKSecretKey payment_key_ref; - CHECK((*env)->GetArrayLength(env, payment_key) == 32); - (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes); - LDKSecretKey delayed_payment_base_key_ref; - CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32); - (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes); - LDKSecretKey htlc_base_key_ref; - CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); - (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes); - LDKThirtyTwoBytes commitment_seed_ref; - CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); - (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); - LDKInMemorySigner ret_var = InMemorySigner_new(node_secret_ref, funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref); +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 logger, int64_t keys_manager, int64_t config, int64_t params) { + void* fee_est_ptr = (void*)(((uintptr_t)fee_est) & ~1); + CHECK_ACCESS(fee_est_ptr); + LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); + if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_est_conv); + } + void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); + CHECK_ACCESS(keys_manager_ptr); + LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); + if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKeysInterface_JCalls_cloned(&keys_manager_conv); + } + LDKUserConfig config_conv; + config_conv.inner = (void*)(config & (~1)); + config_conv.is_owned = (config & 1) || (config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv = UserConfig_clone(&config_conv); + LDKChainParameters params_conv; + params_conv.inner = (void*)(params & (~1)); + params_conv.is_owned = (params & 1) || (params == 0); + 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, logger_conv, keys_manager_conv, config_conv, params_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27413,12 +29790,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1current_1default_1configuration(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); + LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27430,407 +29807,427 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart return ret_ref; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int64_t user_channel_id, int64_t override_config) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); - return ret_conv; + LDKPublicKey their_network_key_ref; + CHECK((*env)->GetArrayLength(env, their_network_key) == 33); + (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form); + LDKUserConfig override_config_conv; + override_config_conv.inner = (void*)(override_config & (~1)); + override_config_conv.is_owned = (override_config & 1) || (override_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); + override_config_conv = UserConfig_clone(&override_config_conv); + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); + return (int64_t)ret_conv; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); - return ret_conv; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; + if (ret_conv_16_var.is_owned) { + ret_conv_16_ref |= 1; + } + ret_arr_ptr[q] = ret_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv); - return ret_conv; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; + if (ret_conv_16_var.is_owned) { + ret_conv_16_ref |= 1; + } + ret_arr_ptr[q] = ret_conv_16_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_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + unsigned char channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, channel_id) == 32); + (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); + unsigned char (*channel_id_ref)[32] = &channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel_1with_1target_1feerate(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id, int32_t target_feerate_sats_per_1000_weight) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + unsigned char channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, channel_id) == 32); + (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); + unsigned char (*channel_id_ref)[32] = &channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight); + return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv); - return ret_conv; + unsigned char channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, channel_id) == 32); + (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); + unsigned char (*channel_id_ref)[32] = &channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_force_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); - spend_tx_ref.data_is_owned = true; - LDKStaticPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = (void*)(descriptor & (~1)); - descriptor_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return (int64_t)ret_conv; + ChannelManager_force_close_all_channels(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); - spend_tx_ref.data_is_owned = true; - LDKDelayedPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = (void*)(descriptor & (~1)); - descriptor_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + LDKRoute route_conv; + route_conv.inner = (void*)(route & (~1)); + route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_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_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSign(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); - *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); - return (int64_t)ret_ret; + LDKRoute route_conv; + route_conv.inner = (void*)(route & (~1)); + route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_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_retry_payment(&this_arg_conv, &route_conv, payment_id_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +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 = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); - *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); - return (int64_t)ret_ret; + 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); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInMemorySigner obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKRoute route_conv; + route_conv.inner = (void*)(route & (~1)); + route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int8_tArray arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKSecretKey arg_ref; - CHECK((*env)->GetArrayLength(env, arg) == 32); - (*env)->GetByteArrayRegion(env, arg, 0, 32, arg_ref.bytes); - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = InMemorySigner_read(ser_ref, arg_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char temporary_channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); + (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); + unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; + 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); + LDKTransaction funding_transaction_ref; + funding_transaction_ref.datalen = (*env)->GetArrayLength(env, funding_transaction); + funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data); + funding_transaction_ref.data_is_owned = true; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKKeysManager this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - KeysManager_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray rgb, int8_tArray alias, int64_tArray addresses) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKThreeBytes rgb_ref; + CHECK((*env)->GetArrayLength(env, rgb) == 3); + (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data); + LDKThirtyTwoBytes alias_ref; + CHECK((*env)->GetArrayLength(env, alias) == 32); + (*env)->GetByteArrayRegion(env, alias, 0, 32, alias_ref.data); + LDKCVec_NetAddressZ addresses_constr; + addresses_constr.datalen = (*env)->GetArrayLength(env, addresses); + if (addresses_constr.datalen > 0) + addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + else + addresses_constr.data = NULL; + int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL); + for (size_t m = 0; m < addresses_constr.datalen; m++) { + int64_t addresses_conv_12 = addresses_vals[m]; + void* addresses_conv_12_ptr = (void*)(((uintptr_t)addresses_conv_12) & ~1); + CHECK_ACCESS(addresses_conv_12_ptr); + LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr); + addresses_constr.data[m] = addresses_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); + ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { - unsigned char seed_arr[32]; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); - unsigned char (*seed_ref)[32] = &seed_arr; - LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelManager_process_pending_htlc_forwards(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKKeysManager this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char params_arr[32]; - CHECK((*env)->GetArrayLength(env, params) == 32); - (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); - unsigned char (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + ChannelManager_timer_tick_occurred(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) { - LDKKeysManager this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); + unsigned char payment_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); + unsigned char (*payment_hash_ref)[32] = &payment_hash_arr; + ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char temporary_channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); + (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); + unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel_1from_1trusted_1peer_10conf(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); - *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPhantomKeysManager this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomKeysManager_free(this_obj_conv); + unsigned char temporary_channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); + (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); + unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; +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) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); - *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { - unsigned char seed_arr[32]; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); - unsigned char (*seed_ref)[32] = &seed_arr; - unsigned char cross_node_seed_arr[32]; - CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32); - (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr); - unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr; - LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) { - LDKPhantomKeysManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKPhantomKeysManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char params_arr[32]; - CHECK((*env)->GetArrayLength(env, params) == 32); - (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); - unsigned char (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelManager this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelManager_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChainParameters this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChainParameters_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); + return (int64_t)ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1network(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv)); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKNetwork val_conv = LDKNetwork_from_java(env, val); - ChainParameters_set_network(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27842,65 +30239,69 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_ return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKBestBlock val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BestBlock_clone(&val_conv); - ChainParameters_set_best_block(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv *env, jclass clz, jclass network_arg, int64_t best_block_arg) { - LDKNetwork network_arg_conv = LDKNetwork_from_java(env, network_arg); - LDKBestBlock best_block_arg_conv; - best_block_arg_conv.inner = (void*)(best_block_arg & (~1)); - best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); - best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); - LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); + return (int64_t)ret_ret; } -static inline uintptr_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { - LDKChainParameters ret_var = ChainParameters_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChannelManager_as_Listen(&this_arg_conv); + return (int64_t)ret_ret; } - return ret_ref; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChainParameters arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update_1timeout(JNIEnv *env, jclass clz, int64_t this_arg, int64_t max_wait) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChainParameters orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelManager_await_persistable_update(&this_arg_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27912,323 +30313,255 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCounterpartyForwardingInfo this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CounterpartyForwardingInfo_free(this_obj_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); + *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCounterpartyForwardingInfo obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_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_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CounterpartyForwardingInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelCounterparty obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_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_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = ChannelCounterparty_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelDetails obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyForwardingInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_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_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = ChannelDetails_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -static inline uintptr_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCounterpartyForwardingInfo arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPhantomRouteHints obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCounterpartyForwardingInfo orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_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_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = PhantomRouteHints_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelCounterparty this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelCounterparty_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelManager obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelCounterparty_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelManagerReadArgs this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelManagerReadArgs_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); + if (val_conv.free == LDKKeysInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKeysInterface_JCalls_cloned(&val_conv); } - return ret_ref; + ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKInitFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = InitFeatures_clone(&val_conv); - ChannelCounterparty_set_features(&this_ptr_conv, val_conv); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); - return ret_conv; + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); + if (val_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); - int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKWatch val_conv = *(LDKWatch*)(val_ptr); + if (val_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&val_conv); } - return ret_ref; + ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCounterpartyForwardingInfo val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = CounterpartyForwardingInfo_clone(&val_conv); - ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JNIEnv *env, jclass clz, int8_tArray node_id_arg, int64_t features_arg, int64_t unspendable_punishment_reserve_arg, int64_t forwarding_info_arg) { - LDKPublicKey node_id_arg_ref; - CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); - (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); - LDKInitFeatures features_arg_conv; - features_arg_conv.inner = (void*)(features_arg & (~1)); - features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = InitFeatures_clone(&features_arg_conv); - LDKCounterpartyForwardingInfo forwarding_info_arg_conv; - forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1)); - forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); - forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); - LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline uintptr_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelCounterparty arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv); - return ret_conv; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelCounterparty orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); + if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&val_conv); } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelDetails this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelDetails_free(this_obj_conv); + ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_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 = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv)); - return ret_arr; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKLogger val_conv = *(LDKLogger*)(val_ptr); + if (val_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); + LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28240,390 +30573,383 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counte return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelCounterparty val_conv; + LDKUserConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelCounterparty_clone(&val_conv); - ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); + val_conv = UserConfig_clone(&val_conv); + ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); + CHECK_ACCESS(keys_manager_ptr); + LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); + if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKeysInterface_JCalls_cloned(&keys_manager_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + LDKUserConfig default_config_conv; + default_config_conv.inner = (void*)(default_config & (~1)); + default_config_conv.is_owned = (default_config & 1) || (default_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); + default_config_conv = UserConfig_clone(&default_config_conv); + LDKCVec_ChannelMonitorZ channel_monitors_constr; + channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors); + if (channel_monitors_constr.datalen > 0) + channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); + else + channel_monitors_constr.data = NULL; + int64_t* channel_monitors_vals = (*env)->GetLongArrayElements (env, channel_monitors, NULL); + for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { + int64_t channel_monitors_conv_16 = channel_monitors_vals[q]; + LDKChannelMonitor channel_monitors_conv_16_conv; + channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1)); + channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); + channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0); + LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr); int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_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); + LDKChannelManagerReadArgs arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = (arg & 1) || (arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); + *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKExpandedKey this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ExpandedKey_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1new(JNIEnv *env, jclass clz, int8_tArray key_material) { + unsigned char key_material_arr[32]; + CHECK((*env)->GetArrayLength(env, key_material) == 32); + (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_arr); + unsigned char (*key_material_ref)[32] = &key_material_arr; + LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref); int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create(JNIEnv *env, jclass clz, int64_t keys, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t keys_manager, int64_t current_time) { + LDKExpandedKey keys_conv; + keys_conv.inner = (void*)(keys & (~1)); + keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); + if (!(keys_manager & 1)) { CHECK_ACCESS(keys_manager_ptr); } + LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr; + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1from_1hash(JNIEnv *env, jclass clz, int64_t keys, int64_t min_value_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t current_time) { + LDKExpandedKey keys_conv; + keys_conv.inner = (void*)(keys & (~1)); + keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDecodeError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DecodeError_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); +static inline uintptr_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { + LDKDecodeError ret_var = DecodeError_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_user_channel_id(&this_ptr_conv, val); -} - -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 = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - 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 = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_balance_msat(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDecodeError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = DecodeError_clone_ptr(&arg_conv); + return ret_conv; } -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 = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDecodeError orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKDecodeError ret_var = DecodeError_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInit this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Init_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); - return ret_conv; + LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); + LDKInitFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InitFeatures_clone(&val_conv); + Init_set_features(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = Init_get_remote_network_address(&this_ptr_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); + LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr); + val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)(((uintptr_t)val) & ~1)); + Init_set_remote_network_address(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jclass clz, int64_t features_arg, int64_t remote_network_address_arg) { + LDKInitFeatures features_arg_conv; + features_arg_conv.inner = (void*)(features_arg & (~1)); + features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = InitFeatures_clone(&features_arg_conv); + void* remote_network_address_arg_ptr = (void*)(((uintptr_t)remote_network_address_arg) & ~1); + CHECK_ACCESS(remote_network_address_arg_ptr); + LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr); + LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); +static inline uintptr_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { + LDKInit ret_var = Init_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); - return ret_conv; + return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_is_outbound(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInit arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = Init_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1funding_1locked(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelDetails_get_is_funding_locked(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInit orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKInit ret_var = Init_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1funding_1locked(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_is_funding_locked(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKErrorMessage this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErrorMessage_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_is_usable(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ErrorMessage_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_is_public(&this_ptr_conv, val); + LDKStr val_conv = java_to_owned_str(env, val); + ErrorMessage_set_data(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray 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 inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKChannelCounterparty counterparty_arg_conv; - counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); - counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); - counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); - LDKOutPoint funding_txo_arg_conv; - funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1)); - funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); - funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); - LDKChannelTypeFeatures channel_type_arg_conv; - channel_type_arg_conv.inner = (void*)(channel_type_arg & (~1)); - channel_type_arg_conv.is_owned = (channel_type_arg & 1) || (channel_type_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); - channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); - void* short_channel_id_arg_ptr = (void*)(((uintptr_t)short_channel_id_arg) & ~1); - CHECK_ACCESS(short_channel_id_arg_ptr); - LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); - short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_arg) & ~1)); - void* inbound_scid_alias_arg_ptr = (void*)(((uintptr_t)inbound_scid_alias_arg) & ~1); - CHECK_ACCESS(inbound_scid_alias_arg_ptr); - LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr); - inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)inbound_scid_alias_arg) & ~1)); - void* unspendable_punishment_reserve_arg_ptr = (void*)(((uintptr_t)unspendable_punishment_reserve_arg) & ~1); - CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); - LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); - void* confirmations_required_arg_ptr = (void*)(((uintptr_t)confirmations_required_arg) & ~1); - CHECK_ACCESS(confirmations_required_arg_ptr); - LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr); - confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)confirmations_required_arg) & ~1)); - void* force_close_spend_delay_arg_ptr = (void*)(((uintptr_t)force_close_spend_delay_arg) & ~1); - CHECK_ACCESS(force_close_spend_delay_arg_ptr); - LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); - force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)force_close_spend_delay_arg) & ~1)); - LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); + LDKStr data_arg_conv = java_to_owned_str(env, data_arg); + LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28635,8 +30961,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv return ret_ref; } -static inline uintptr_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { - LDKChannelDetails ret_var = ChannelDetails_clone(arg); +static inline uintptr_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { + LDKErrorMessage ret_var = ErrorMessage_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28647,21 +30973,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelDetails arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorMessage arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); + int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelDetails orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKErrorMessage orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); + LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28673,252 +30999,154 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEn return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelDetails this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKWarningMessage this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + WarningMessage_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); - FREE((void*)this_ptr); - PaymentSendFailure_free(this_ptr_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWarningMessage this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *WarningMessage_get_channel_id(&this_ptr_conv)); + return ret_arr; } -static inline uintptr_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - 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*)arg; - int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKWarningMessage this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + WarningMessage_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWarningMessage this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = (void*)(((uintptr_t)a) & ~1); - CHECK_ACCESS(a_ptr); - LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); - a_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a) & ~1)); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_parameter_error(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKWarningMessage this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + WarningMessage_set_data(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) { - LDKCVec_CResult_NoneAPIErrorZZ a_constr; - a_constr.datalen = (*env)->GetArrayLength(env, a); - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); - for (size_t w = 0; w < a_constr.datalen; w++) { - int64_t a_conv_22 = a_vals[w]; - void* a_conv_22_ptr = (void*)(((uintptr_t)a_conv_22) & ~1); - 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*)(((uintptr_t)a_conv_22) & ~1)); - a_constr.data[w] = a_conv_22_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKStr data_arg_conv = java_to_owned_str(env, data_arg); + LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - (*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 = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_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 = (void*)(((uintptr_t)a_conv_10) & ~1); - CHECK_ACCESS(a_conv_10_ptr); - LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); - a_conv_10_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a_conv_10) & ~1)); - 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_retry_safe(a_constr); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) { + LDKWarningMessage ret_var = WarningMessage_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -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 = (void*)(((uintptr_t)results_conv_22) & ~1); - CHECK_ACCESS(results_conv_22_ptr); - LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); - results_constr.data[w] = results_conv_22_conv; - } - (*env)->ReleaseLongArrayElements(env, results, results_vals, 0); - LDKRouteParameters failed_paths_retry_conv; - failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1)); - failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0); - 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 = (uintptr_t)ret_copy; return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPhantomRouteHints this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomRouteHints_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKWarningMessage arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; - if (ret_conv_16_var.is_owned) { - ret_conv_16_ref |= 1; - } - ret_arr_ptr[q] = ret_conv_16_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKWarningMessage orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_ChannelDetailsZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t q = 0; q < val_constr.datalen; q++) { - int64_t val_conv_16 = val_vals[q]; - LDKChannelDetails val_conv_16_conv; - val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); - val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); - val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv); - val_constr.data[q] = val_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPing this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Ping_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); + int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPhantomRouteHints this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); + Ping_set_ponglen(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; + int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKPhantomRouteHints this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); + Ping_set_byteslen(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { - LDKCVec_ChannelDetailsZ channels_arg_constr; - channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg); - if (channels_arg_constr.datalen > 0) - channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL); - for (size_t q = 0; q < channels_arg_constr.datalen; q++) { - int64_t channels_arg_conv_16 = channels_arg_vals[q]; - LDKChannelDetails channels_arg_conv_16_conv; - channels_arg_conv_16_conv.inner = (void*)(channels_arg_conv_16 & (~1)); - channels_arg_conv_16_conv.is_owned = (channels_arg_conv_16 & 1) || (channels_arg_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); - channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); - channels_arg_constr.data[q] = channels_arg_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0); - LDKPublicKey real_node_pubkey_arg_ref; - CHECK((*env)->GetArrayLength(env, real_node_pubkey_arg) == 33); - (*env)->GetByteArrayRegion(env, real_node_pubkey_arg, 0, 33, real_node_pubkey_arg_ref.compressed_form); - LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) { + LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28930,8 +31158,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1new(JNIE return ret_ref; } -static inline uintptr_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg); +static inline uintptr_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { + LDKPing ret_var = Ping_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28942,21 +31170,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPhantomRouteHints arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPing arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv); + int64_t ret_conv = Ping_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPhantomRouteHints orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPing orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv); + LDKPing ret_var = Ping_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28968,53 +31196,33 @@ 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 logger, int64_t keys_manager, int64_t config, int64_t params) { - void* fee_est_ptr = (void*)(((uintptr_t)fee_est) & ~1); - CHECK_ACCESS(fee_est_ptr); - LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); - if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_est_conv); - } - void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); - CHECK_ACCESS(keys_manager_ptr); - LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); - if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKeysInterface_JCalls_cloned(&keys_manager_conv); - } - LDKUserConfig config_conv; - config_conv.inner = (void*)(config & (~1)); - config_conv.is_owned = (config & 1) || (config == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv = UserConfig_clone(&config_conv); - LDKChainParameters params_conv; - params_conv.inner = (void*)(params & (~1)); - params_conv.is_owned = (params & 1) || (params == 0); - 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, logger_conv, keys_manager_conv, config_conv, params_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPong this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Pong_free(this_obj_conv); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPong this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKPong this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + Pong_set_byteslen(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) { + LDKPong ret_var = Pong_new(byteslen_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -29026,12 +31234,33 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1current_1default_1configuration(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); +static inline uintptr_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { + LDKPong ret_var = Pong_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPong arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = Pong_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPong orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKPong ret_var = Pong_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -29043,969 +31272,730 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1curren return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int64_t user_channel_id, int64_t override_config) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKPublicKey their_network_key_ref; - CHECK((*env)->GetArrayLength(env, their_network_key) == 33); - (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form); - LDKUserConfig override_config_conv; - override_config_conv.inner = (void*)(override_config & (~1)); - override_config_conv.is_owned = (override_config & 1) || (override_config == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); - override_config_conv = UserConfig_clone(&override_config_conv); - LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOpenChannel this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OpenChannel_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; - if (ret_conv_16_var.is_owned) { - ret_conv_16_ref |= 1; - } - ret_arr_ptr[q] = ret_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; - if (ret_conv_16_var.is_owned) { - ret_conv_16_ref |= 1; - } - ret_arr_ptr[q] = ret_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + OpenChannel_set_chain_hash(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, channel_id) == 32); - (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); - unsigned char (*channel_id_ref)[32] = &channel_id_arr; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel_1with_1target_1feerate(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int32_t target_feerate_sats_per_1000_weight) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, channel_id) == 32); - (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); - unsigned char (*channel_id_ref)[32] = &channel_id_arr; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, target_feerate_sats_per_1000_weight); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, channel_id) == 32); - (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); - unsigned char (*channel_id_ref)[32] = &channel_id_arr; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_channel(&this_arg_conv, channel_id_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_funding_satoshis(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - ChannelManager_force_close_all_channels(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKRoute route_conv; - route_conv.inner = (void*)(route & (~1)); - route_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_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_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_push_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKRoute route_conv; - route_conv.inner = (void*)(route & (~1)); - route_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_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_retry_payment(&this_arg_conv, &route_conv, payment_id_ref); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); + return ret_conv; } -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 = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - 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); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKRoute route_conv; - route_conv.inner = (void*)(route & (~1)); - route_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray funding_transaction) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char temporary_channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); - (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); - unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; - LDKTransaction funding_transaction_ref; - funding_transaction_ref.datalen = (*env)->GetArrayLength(env, funding_transaction); - funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data); - funding_transaction_ref.data_is_owned = true; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, funding_transaction_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray rgb, int8_tArray alias, int64_tArray addresses) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKThreeBytes rgb_ref; - CHECK((*env)->GetArrayLength(env, rgb) == 3); - (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data); - LDKThirtyTwoBytes alias_ref; - CHECK((*env)->GetArrayLength(env, alias) == 32); - (*env)->GetByteArrayRegion(env, alias, 0, 32, alias_ref.data); - LDKCVec_NetAddressZ addresses_constr; - addresses_constr.datalen = (*env)->GetArrayLength(env, addresses); - if (addresses_constr.datalen > 0) - addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); - else - addresses_constr.data = NULL; - int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL); - for (size_t m = 0; m < addresses_constr.datalen; m++) { - int64_t addresses_conv_12 = addresses_vals[m]; - void* addresses_conv_12_ptr = (void*)(((uintptr_t)addresses_conv_12) & ~1); - CHECK_ACCESS(addresses_conv_12_ptr); - LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr); - addresses_constr.data[m] = addresses_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); - ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - ChannelManager_process_pending_htlc_forwards(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - ChannelManager_timer_tick_occurred(&this_arg_conv); +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char payment_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); - unsigned char (*payment_hash_ref)[32] = &payment_hash_arr; - jboolean ret_conv = ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_preimage) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); - jboolean ret_conv = ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int64_t user_channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char temporary_channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); - (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); - unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, user_channel_id); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -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) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); - LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); - LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_payment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChannelManager_as_Listen(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update_1timeout(JNIEnv *env, jclass clz, int64_t this_arg, int64_t max_wait) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - ChannelManager_await_persistable_update(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_channel_flags(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv); int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); - *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCounterpartyForwardingInfo obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelTypeFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTypeFeatures_clone(&val_conv); + OpenChannel_set_channel_type(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_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_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CounterpartyForwardingInfo_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +static inline uintptr_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { + LDKOpenChannel ret_var = OpenChannel_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelCounterparty obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_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_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = ChannelCounterparty_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOpenChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelDetails obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOpenChannel orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_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_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = ChannelDetails_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKAcceptChannel this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + AcceptChannel_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPhantomRouteHints obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_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_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = PhantomRouteHints_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelManager obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelManagerReadArgs this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelManagerReadArgs_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; - return ret_ret; + int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); - if (val_conv.free == LDKKeysInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKeysInterface_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv); + AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; - return ret_ret; + int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); - if (val_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); + AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; - return ret_ret; + int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKWatch val_conv = *(LDKWatch*)(val_ptr); - if (val_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); + AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; - return ret_ret; + int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); - if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); + AcceptChannel_set_minimum_depth(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; - return ret_ret; + int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKLogger val_conv = *(LDKLogger*)(val_ptr); - if (val_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); + AcceptChannel_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUserConfig val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UserConfig_clone(&val_conv); - ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); + AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { - void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); - CHECK_ACCESS(keys_manager_ptr); - LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); - if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKeysInterface_JCalls_cloned(&keys_manager_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - LDKUserConfig default_config_conv; - default_config_conv.inner = (void*)(default_config & (~1)); - default_config_conv.is_owned = (default_config & 1) || (default_config == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); - default_config_conv = UserConfig_clone(&default_config_conv); - LDKCVec_ChannelMonitorZ channel_monitors_constr; - channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors); - if (channel_monitors_constr.datalen > 0) - channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); - else - channel_monitors_constr.data = NULL; - int64_t* channel_monitors_vals = (*env)->GetLongArrayElements (env, channel_monitors, NULL); - for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { - int64_t channel_monitors_conv_16 = channel_monitors_vals[q]; - LDKChannelMonitor channel_monitors_conv_16_conv; - channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1)); - channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); - channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0); - LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_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); - LDKChannelManagerReadArgs arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = (arg & 1) || (arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); - *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDecodeError this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DecodeError_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -static inline uintptr_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { - LDKDecodeError ret_var = DecodeError_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); } - return ret_ref; + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDecodeError arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = DecodeError_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_payment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDecodeError orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKDecodeError ret_var = DecodeError_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInit this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Init_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInit this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInit this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKInitFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = InitFeatures_clone(&val_conv); - Init_set_features(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInit this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = Init_get_remote_network_address(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInit this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr); - val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)(((uintptr_t)val) & ~1)); - Init_set_remote_network_address(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jclass clz, int64_t features_arg, int64_t remote_network_address_arg) { - LDKInitFeatures features_arg_conv; - features_arg_conv.inner = (void*)(features_arg & (~1)); - features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = InitFeatures_clone(&features_arg_conv); - void* remote_network_address_arg_ptr = (void*)(((uintptr_t)remote_network_address_arg) & ~1); - CHECK_ACCESS(remote_network_address_arg_ptr); - LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr); - LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv); int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } } return ret_ref; } -static inline uintptr_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { - LDKInit ret_var = Init_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelTypeFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTypeFeatures_clone(&val_conv); + AcceptChannel_set_channel_type(&this_ptr_conv, val_conv); +} + +static inline uintptr_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { + LDKAcceptChannel ret_var = AcceptChannel_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30016,21 +32006,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInit arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAcceptChannel arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Init_clone_ptr(&arg_conv); + int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInit orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAcceptChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKInit ret_var = Init_clone(&orig_conv); + LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30042,61 +32032,105 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKErrorMessage this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFundingCreated this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErrorMessage_free(this_obj_conv); + FundingCreated_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErrorMessage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKErrorMessage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingCreated this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingCreated this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ErrorMessage_set_channel_id(&this_ptr_conv, val_ref); + FundingCreated_set_funding_output_index(&this_ptr_conv, val); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErrorMessage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKErrorMessage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - ErrorMessage_set_data(&this_ptr_conv, val_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + FundingCreated_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKStr data_arg_conv = java_to_owned_str(env, data_arg); - LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { + LDKThirtyTwoBytes temporary_channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, temporary_channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data); + LDKThirtyTwoBytes funding_txid_arg_ref; + CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32); + (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data); + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30108,8 +32142,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e return ret_ref; } -static inline uintptr_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { - LDKErrorMessage ret_var = ErrorMessage_clone(arg); +static inline uintptr_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { + LDKFundingCreated ret_var = FundingCreated_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30120,21 +32154,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKErrorMessage arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingCreated arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv); + int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKErrorMessage orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFundingCreated orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); + LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30146,61 +32180,64 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKWarningMessage this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFundingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - WarningMessage_free(this_obj_conv); + FundingSigned_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWarningMessage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *WarningMessage_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKWarningMessage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - WarningMessage_set_channel_id(&this_ptr_conv, val_ref); + FundingSigned_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWarningMessage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKWarningMessage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - WarningMessage_set_data(&this_ptr_conv, val_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + FundingSigned_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKStr data_arg_conv = java_to_owned_str(env, data_arg); - LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv); + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30212,8 +32249,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv return ret_ref; } -static inline uintptr_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) { - LDKWarningMessage ret_var = WarningMessage_clone(arg); +static inline uintptr_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { + LDKFundingSigned ret_var = FundingSigned_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30224,21 +32261,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKWarningMessage arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv); + int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKWarningMessage orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFundingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv); + LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30250,50 +32287,91 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEn return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPing this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelReady this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Ping_free(this_obj_conv); + ChannelReady_free(this_obj_conv); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPing this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReady_get_channel_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKPing this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - Ping_set_ponglen(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelReady_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPing this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKPing this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - Ping_set_byteslen(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) { - LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReady this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelReady this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_t short_channel_id_alias_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKPublicKey next_per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form); + void* short_channel_id_alias_arg_ptr = (void*)(((uintptr_t)short_channel_id_alias_arg) & ~1); + CHECK_ACCESS(short_channel_id_alias_arg_ptr); + LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr); + short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_alias_arg) & ~1)); + LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30305,8 +32383,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla return ret_ref; } -static inline uintptr_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { - LDKPing ret_var = Ping_clone(arg); +static inline uintptr_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) { + LDKChannelReady ret_var = ChannelReady_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30317,21 +32395,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPing arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelReady arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Ping_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPing orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelReady orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKPing ret_var = Ping_clone(&orig_conv); + LDKChannelReady ret_var = ChannelReady_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30343,33 +32421,67 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPong this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKShutdown this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Pong_free(this_obj_conv); + Shutdown_free(this_obj_conv); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPong this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKPong this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - Pong_set_byteslen(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + Shutdown_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) { - LDKPong ret_var = Pong_new(byteslen_arg); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKShutdown this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKu8slice ret_var = Shutdown_get_scriptpubkey(&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); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKShutdown this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKCVec_u8Z scriptpubkey_arg_ref; + scriptpubkey_arg_ref.datalen = (*env)->GetArrayLength(env, scriptpubkey_arg); + scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data); + LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30381,8 +32493,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla return ret_ref; } -static inline uintptr_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { - LDKPong ret_var = Pong_clone(arg); +static inline uintptr_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { + LDKShutdown ret_var = Shutdown_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30393,21 +32505,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPong arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdown arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Pong_clone_ptr(&arg_conv); + int64_t ret_conv = Shutdown_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPong orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKShutdown orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKPong ret_var = Pong_clone(&orig_conv); + LDKShutdown ret_var = Shutdown_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30419,358 +32531,172 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOpenChannel this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKClosingSignedFeeRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OpenChannel_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - OpenChannel_set_chain_hash(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_funding_satoshis(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_push_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_to_self_delay(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); + ClosingSignedFeeRange_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_payment_point(&this_ptr_conv, val_ref); + ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); + ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new(JNIEnv *env, jclass clz, int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) { + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSignedFeeRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClosingSignedFeeRange orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKClosingSigned this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ClosingSigned_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ClosingSigned_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); + ClosingSigned_set_fee_satoshis(&this_ptr_conv, val); } -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_channel_flags(&this_ptr_conv, val); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ClosingSigned_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv); + LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); int64_t ret_ref = 0; if ((uintptr_t)ret_var.inner > 4096) { CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -30784,21 +32710,45 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1 return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures val_conv; + LDKClosingSignedFeeRange val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - OpenChannel_set_channel_type(&this_ptr_conv, val_conv); + val_conv = ClosingSignedFeeRange_clone(&val_conv); + ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } -static inline uintptr_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { - LDKOpenChannel ret_var = OpenChannel_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_t fee_range_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKClosingSignedFeeRange fee_range_arg_conv; + fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); + fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); + fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); + LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { + LDKClosingSigned ret_var = ClosingSigned_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30809,21 +32759,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOpenChannel arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv); + int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOpenChannel orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClosingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); + LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30835,314 +32785,317 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv * return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKAcceptChannel this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateAddHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - AcceptChannel_free(this_obj_conv); + UpdateAddHTLC_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); + UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); + int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); + UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); + UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); + int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); + UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv); - return ret_conv; +static inline uintptr_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_minimum_depth(&this_ptr_conv, val); + return ret_ref; } - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateAddHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_to_self_delay(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateAddHTLC orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFulfillHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UpdateFulfillHTLC_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); + UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_payment_point(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKThirtyTwoBytes payment_preimage_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data); + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); +static inline uintptr_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFulfillHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateFulfillHTLC orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFailHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UpdateFailHTLC_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv); - int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - } - return ret_ref; + int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - AcceptChannel_set_channel_type(&this_ptr_conv, val_conv); + UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val); } -static inline uintptr_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { - LDKAcceptChannel ret_var = AcceptChannel_clone(arg); +static inline uintptr_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31153,21 +33106,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAcceptChannel arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv); + int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAcceptChannel orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateFailHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31179,118 +33132,71 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFundingCreated this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFailMalformedHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FundingCreated_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingCreated this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref); + UpdateFailMalformedHTLC_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); + UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv); + int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - FundingCreated_set_funding_output_index(&this_ptr_conv, val); + UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form); - return ret_arr; + int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - FundingCreated_set_signature(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, temporary_channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data); - LDKThirtyTwoBytes funding_txid_arg_ref; - CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32); - (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data); - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val); } -static inline uintptr_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { - LDKFundingCreated ret_var = FundingCreated_clone(arg); +static inline uintptr_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31301,21 +33207,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFundingCreated arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailMalformedHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv); + int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFundingCreated orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateFailMalformedHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31327,64 +33233,98 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEn return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFundingSigned this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FundingSigned_free(this_obj_conv); + CommitmentSigned_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - FundingSigned_set_channel_id(&this_ptr_conv, val_ref); + CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - FundingSigned_set_signature(&this_ptr_conv, val_ref); + CommitmentSigned_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { + LDKCommitmentSigned this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_SignatureZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + val_constr.data = NULL; + for (size_t i = 0; i < val_constr.datalen; i++) { + int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); + LDKSignature val_conv_8_ref; + CHECK((*env)->GetArrayLength(env, val_conv_8) == 64); + (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form); + val_constr.data[i] = val_conv_8_ref; + } + CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg, jobjectArray htlc_signatures_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); LDKSignature signature_arg_ref; CHECK((*env)->GetArrayLength(env, signature_arg) == 64); (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref); + LDKCVec_SignatureZ htlc_signatures_arg_constr; + htlc_signatures_arg_constr.datalen = (*env)->GetArrayLength(env, htlc_signatures_arg); + if (htlc_signatures_arg_constr.datalen > 0) + htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + htlc_signatures_arg_constr.data = NULL; + for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) { + int8_tArray htlc_signatures_arg_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i); + LDKSignature htlc_signatures_arg_conv_8_ref; + CHECK((*env)->GetArrayLength(env, htlc_signatures_arg_conv_8) == 64); + (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form); + htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref; + } + LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31396,8 +33336,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * return ret_ref; } -static inline uintptr_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { - LDKFundingSigned ret_var = FundingSigned_clone(arg); +static inline uintptr_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { + LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31408,21 +33348,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFundingSigned arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv); + int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFundingSigned orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCommitmentSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); + LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31434,91 +33374,88 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFundingLocked this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRevokeAndACK this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FundingLocked_free(this_obj_conv); + RevokeAndACK_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingLocked_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - FundingLocked_set_channel_id(&this_ptr_conv, val_ref); + RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - FundingLocked_set_next_per_commitment_point(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = FundingLocked_get_short_channel_id_alias(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); - FundingLocked_set_short_channel_id_alias(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_t short_channel_id_alias_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKThirtyTwoBytes per_commitment_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data); LDKPublicKey next_per_commitment_point_arg_ref; CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33); (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form); - void* short_channel_id_alias_arg_ptr = (void*)(((uintptr_t)short_channel_id_alias_arg) & ~1); - CHECK_ACCESS(short_channel_id_alias_arg_ptr); - LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr); - short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_alias_arg) & ~1)); - LDKFundingLocked ret_var = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv); + LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31530,8 +33467,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * return ret_ref; } -static inline uintptr_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) { - LDKFundingLocked ret_var = FundingLocked_clone(arg); +static inline uintptr_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { + LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31542,21 +33479,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFundingLocked arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRevokeAndACK arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = FundingLocked_clone_ptr(&arg_conv); + int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFundingLocked orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRevokeAndACK orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv); + LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31568,67 +33505,57 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKShutdown this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Shutdown_free(this_obj_conv); + UpdateFee_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKShutdown this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKShutdown this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - Shutdown_set_channel_id(&this_ptr_conv, val_ref); + UpdateFee_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKShutdown this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKu8slice ret_var = Shutdown_get_scriptpubkey(&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); - return ret_arr; + int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKShutdown this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); + UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKCVec_u8Z scriptpubkey_arg_ref; - scriptpubkey_arg_ref.datalen = (*env)->GetArrayLength(env, scriptpubkey_arg); - scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data); - LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref); + LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31640,8 +33567,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, return ret_ref; } -static inline uintptr_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { - LDKShutdown ret_var = Shutdown_clone(arg); +static inline uintptr_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { + LDKUpdateFee ret_var = UpdateFee_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31652,21 +33579,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKShutdown arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFee arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Shutdown_clone_ptr(&arg_conv); + int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKShutdown orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateFee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKShutdown ret_var = Shutdown_clone(&orig_conv); + LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31678,50 +33605,102 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKClosingSignedFeeRange this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDataLossProtect this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClosingSignedFeeRange_free(this_obj_conv); + DataLossProtect_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSignedFeeRange this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClosingSignedFeeRange this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSignedFeeRange this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClosingSignedFeeRange this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new(JNIEnv *env, jclass clz, int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) { - LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv *env, jclass clz, int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg) { + LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, your_last_per_commitment_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data); + LDKPublicKey my_current_per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form); + LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { + LDKDataLossProtect ret_var = DataLossProtect_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDataLossProtect arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDataLossProtect orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31733,8 +33712,71 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new( return ret_ref; } -static inline uintptr_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { - LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelReestablish this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelReestablish_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val); +} + +static inline uintptr_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { + LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31745,21 +33787,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClosingSignedFeeRange arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelReestablish arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClosingSignedFeeRange orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelReestablish orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); + LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31771,118 +33813,105 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clon return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKClosingSigned this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKAnnouncementSignatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClosingSigned_free(this_obj_conv); + AnnouncementSignatures_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ClosingSigned_set_channel_id(&this_ptr_conv, val_ref); + AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv); + int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ClosingSigned_set_fee_satoshis(&this_ptr_conv, val); + AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ClosingSigned_set_signature(&this_ptr_conv, val_ref); + AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); - int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - } - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKClosingSignedFeeRange val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ClosingSignedFeeRange_clone(&val_conv); - ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_t fee_range_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKClosingSignedFeeRange fee_range_arg_conv; - fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); - fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); - fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); - LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); + LDKSignature node_signature_arg_ref; + CHECK((*env)->GetArrayLength(env, node_signature_arg) == 64); + (*env)->GetByteArrayRegion(env, node_signature_arg, 0, 64, node_signature_arg_ref.compact_form); + LDKSignature bitcoin_signature_arg_ref; + CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64); + (*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form); + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31894,8 +33923,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * return ret_ref; } -static inline uintptr_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { - LDKClosingSigned ret_var = ClosingSigned_clone(arg); +static inline uintptr_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31906,21 +33935,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClosingSigned arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAnnouncementSignatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv); + int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClosingSigned orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAnnouncementSignatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31932,109 +33961,238 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateAddHTLC this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr); + FREE((void*)this_ptr); + NetAddress_free(this_ptr_conv); +} + +static inline uintptr_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetAddress* arg_conv = (LDKNetAddress*)arg; + int64_t ret_conv = NetAddress_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNetAddress* orig_conv = (LDKNetAddress*)orig; + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) { + LDKFourBytes addr_ref; + CHECK((*env)->GetArrayLength(env, addr) == 4); + (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data); + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_ipv4(addr_ref, port); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) { + LDKSixteenBytes addr_ref; + CHECK((*env)->GetArrayLength(env, addr) == 16); + (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data); + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_ipv6(addr_ref, port); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) { + LDKTwelveBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 12); + (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data); + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_onion_v2(a_ref); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v3(JNIEnv *env, jclass clz, int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) { + LDKThirtyTwoBytes ed25519_pubkey_ref; + CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32); + (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data); + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNetAddress* obj_conv = (LDKNetAddress*)obj; + LDKCVec_u8Z ret_var = NetAddress_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_NetAddress_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_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = NetAddress_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateAddHTLC_free(this_obj_conv); + UnsignedNodeAnnouncement_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv)); - return ret_arr; + LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKNodeFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv); + int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val); + UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 3); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref); + LDKThreeBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 3); + (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); + UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref); } -static inline uintptr_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { - LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_NetAddressZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t m = 0; m < val_constr.datalen; m++) { + int64_t val_conv_12 = val_vals[m]; + void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1); + CHECK_ACCESS(val_conv_12_ptr); + LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr); + val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1)); + val_constr.data[m] = val_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); +} + +static inline uintptr_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32045,21 +34203,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateAddHTLC arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedNodeAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv); + int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateAddHTLC orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32071,81 +34229,75 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateFulfillHTLC this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateFulfillHTLC_free(this_obj_conv); + NodeAnnouncement_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFulfillHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFulfillHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFulfillHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateFulfillHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + NodeAnnouncement_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFulfillHTLC this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv)); - return ret_arr; + LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFulfillHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); + LDKUnsignedNodeAnnouncement val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UnsignedNodeAnnouncement_clone(&val_conv); + NodeAnnouncement_set_contents(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKThirtyTwoBytes payment_preimage_arg_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data); - LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) { + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKUnsignedNodeAnnouncement contents_arg_conv; + contents_arg_conv.inner = (void*)(contents_arg & (~1)); + contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); + contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); + LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32157,8 +34309,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE return ret_ref; } -static inline uintptr_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { - LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); +static inline uintptr_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { + LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32169,21 +34321,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateFulfillHTLC arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateFulfillHTLC orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); + LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32195,155 +34347,168 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JN return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateFailHTLC this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateFailHTLC_free(this_obj_conv); + UnsignedChannelAnnouncement_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailHTLC this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFailHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref); + UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailHTLC this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv); + int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateFailHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val); -} - -static inline uintptr_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { - LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateFailHTLC arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv); - return ret_conv; + UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateFailHTLC orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateFailMalformedHTLC this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateFailMalformedHTLC_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); } -static inline uintptr_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { - LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); +static inline uintptr_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { + LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32354,21 +34519,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateFailMalformedHTLC arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); + int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateFailMalformedHTLC orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); + LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32380,98 +34545,147 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1cl return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCommitmentSigned this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CommitmentSigned_free(this_obj_conv); + ChannelAnnouncement_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - CommitmentSigned_set_signature(&this_ptr_conv, val_ref); + ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_SignatureZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - val_constr.data = NULL; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); - LDKSignature val_conv_8_ref; - CHECK((*env)->GetArrayLength(env, val_conv_8) == 64); - (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form); - val_constr.data[i] = val_conv_8_ref; - } - CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg, jobjectArray htlc_signatures_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKCVec_SignatureZ htlc_signatures_arg_constr; - htlc_signatures_arg_constr.datalen = (*env)->GetArrayLength(env, htlc_signatures_arg); - if (htlc_signatures_arg_constr.datalen > 0) - htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - htlc_signatures_arg_constr.data = NULL; - for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) { - int8_tArray htlc_signatures_arg_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i); - LDKSignature htlc_signatures_arg_conv_8_ref; - CHECK((*env)->GetArrayLength(env, htlc_signatures_arg_conv_8) == 64); - (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form); - htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKUnsignedChannelAnnouncement val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UnsignedChannelAnnouncement_clone(&val_conv); + ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray node_signature_1_arg, int8_tArray node_signature_2_arg, int8_tArray bitcoin_signature_1_arg, int8_tArray bitcoin_signature_2_arg, int64_t contents_arg) { + LDKSignature node_signature_1_arg_ref; + CHECK((*env)->GetArrayLength(env, node_signature_1_arg) == 64); + (*env)->GetByteArrayRegion(env, node_signature_1_arg, 0, 64, node_signature_1_arg_ref.compact_form); + LDKSignature node_signature_2_arg_ref; + CHECK((*env)->GetArrayLength(env, node_signature_2_arg) == 64); + (*env)->GetByteArrayRegion(env, node_signature_2_arg, 0, 64, node_signature_2_arg_ref.compact_form); + LDKSignature bitcoin_signature_1_arg_ref; + CHECK((*env)->GetArrayLength(env, bitcoin_signature_1_arg) == 64); + (*env)->GetByteArrayRegion(env, bitcoin_signature_1_arg, 0, 64, bitcoin_signature_1_arg_ref.compact_form); + LDKSignature bitcoin_signature_2_arg_ref; + CHECK((*env)->GetArrayLength(env, bitcoin_signature_2_arg) == 64); + (*env)->GetByteArrayRegion(env, bitcoin_signature_2_arg, 0, 64, bitcoin_signature_2_arg_ref.compact_form); + LDKUnsignedChannelAnnouncement contents_arg_conv; + contents_arg_conv.inner = (void*)(contents_arg & (~1)); + contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); + contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); + LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32483,8 +34697,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn return ret_ref; } -static inline uintptr_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { - LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); +static inline uintptr_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { + LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32495,21 +34709,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCommitmentSigned arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCommitmentSigned orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); + LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32521,201 +34735,168 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRevokeAndACK this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RevokeAndACK_free(this_obj_conv); + UnsignedChannelUpdate_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref); + UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv)); - return ret_arr; + int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref); + UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); + UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKThirtyTwoBytes per_commitment_secret_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_secret_arg) == 32); - (*env)->GetByteArrayRegion(env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data); - LDKPublicKey next_per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form); - LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); + return ret_conv; } -static inline uintptr_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { - LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRevokeAndACK arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv); + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRevokeAndACK orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateFee this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateFee_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFee this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv)); - return ret_arr; + UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFee this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFee_set_channel_id(&this_ptr_conv, val_ref); + int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFee this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv); + UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUpdateFee this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + 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); + UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref); } -static inline uintptr_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { - LDKUpdateFee ret_var = UpdateFee_clone(arg); +static inline uintptr_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32726,21 +34907,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateFee arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv); + int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateFee orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32752,64 +34933,75 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *en return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDataLossProtect this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DataLossProtect_free(this_obj_conv); + ChannelUpdate_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDataLossProtect this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDataLossProtect this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ChannelUpdate_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDataLossProtect this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDataLossProtect this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref); + LDKUnsignedChannelUpdate val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UnsignedChannelUpdate_clone(&val_conv); + ChannelUpdate_set_contents(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv *env, jclass clz, int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg) { - LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref; - CHECK((*env)->GetArrayLength(env, your_last_per_commitment_secret_arg) == 32); - (*env)->GetByteArrayRegion(env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data); - LDKPublicKey my_current_per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form); - LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) { + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKUnsignedChannelUpdate contents_arg_conv; + contents_arg_conv.inner = (void*)(contents_arg & (~1)); + contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); + contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); + LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32821,8 +35013,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv return ret_ref; } -static inline uintptr_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { - LDKDataLossProtect ret_var = DataLossProtect_clone(arg); +static inline uintptr_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { + LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32833,21 +35025,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDataLossProtect arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDataLossProtect orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); + LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32859,71 +35051,87 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelReestablish this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKQueryChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelReestablish_free(this_obj_conv); + QueryChannelRange_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref); + QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv); + int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val); + QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv); + int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val); + QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); } -static inline uintptr_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { - LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { + LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32934,21 +35142,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelReestablish arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryChannelRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv); + int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelReestablish orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKQueryChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); + LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32960,105 +35168,123 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(J return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKAnnouncementSignatures this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReplyChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - AnnouncementSignatures_free(this_obj_conv); + ReplyChannelRange_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref); + ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv); + int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val); + ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form); - return ret_arr; + int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref); + ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form); - return ret_arr; + jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); + ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKSignature node_signature_arg_ref; - CHECK((*env)->GetArrayLength(env, node_signature_arg) == 64); - (*env)->GetByteArrayRegion(env, node_signature_arg, 0, 64, node_signature_arg_ref.compact_form); - LDKSignature bitcoin_signature_arg_ref; - CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64); - (*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form); - LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKReplyChannelRange this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_u64Z val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg, jboolean sync_complete_arg, int64_tArray short_channel_ids_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKCVec_u64Z short_channel_ids_arg_constr; + short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg); + if (short_channel_ids_arg_constr.datalen > 0) + short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + short_channel_ids_arg_constr.data = NULL; + int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL); + for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { + int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g]; + short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6; + } + (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0); + LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33070,8 +35296,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new return ret_ref; } -static inline uintptr_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { - LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); +static inline uintptr_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { + LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33082,264 +35308,111 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAnnouncementSignatures arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyChannelRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv); + int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAnnouncementSignatures orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReplyChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr); - FREE((void*)this_ptr); - NetAddress_free(this_ptr_conv); -} - -static inline uintptr_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNetAddress* arg_conv = (LDKNetAddress*)arg; - int64_t ret_conv = NetAddress_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNetAddress* orig_conv = (LDKNetAddress*)orig; - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) { - LDKFourBytes addr_ref; - CHECK((*env)->GetArrayLength(env, addr) == 4); - (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data); - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_ipv4(addr_ref, port); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) { - LDKSixteenBytes addr_ref; - CHECK((*env)->GetArrayLength(env, addr) == 16); - (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data); - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_ipv6(addr_ref, port); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) { - LDKTwelveBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 12); - (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data); - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_onion_v2(a_ref); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v3(JNIEnv *env, jclass clz, int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) { - LDKThirtyTwoBytes ed25519_pubkey_ref; - CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32); - (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data); - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNetAddress* obj_conv = (LDKNetAddress*)obj; - LDKCVec_u8Z ret_var = NetAddress_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_NetAddress_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_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); - *ret_conv = NetAddress_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedNodeAnnouncement this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedNodeAnnouncement_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); + LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKNodeFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 3); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv)); - return ret_arr; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThreeBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 3); - (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); - UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKQueryShortChannelIds this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + QueryShortChannelIds_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref); + QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_NetAddressZ val_constr; + LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else val_constr.data = NULL; int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1); - CHECK_ACCESS(val_conv_12_ptr); - LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr); - val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1)); - val_constr.data[m] = val_conv_12_conv; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; } (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); + QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr); } -static inline uintptr_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { - LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKCVec_u64Z short_channel_ids_arg_constr; + short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg); + if (short_channel_ids_arg_constr.datalen > 0) + short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + short_channel_ids_arg_constr.data = NULL; + int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL); + for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { + int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g]; + short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6; + } + (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0); + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33350,21 +35423,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedNodeAnnouncement arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryShortChannelIds arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); + int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedNodeAnnouncement orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKQueryShortChannelIds orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33376,75 +35449,57 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1c return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeAnnouncement this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReplyShortChannelIdsEnd this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAnnouncement_free(this_obj_conv); + ReplyShortChannelIdsEnd_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncement this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKNodeAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - NodeAnnouncement_set_signature(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncement this_ptr_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedNodeAnnouncement val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UnsignedNodeAnnouncement_clone(&val_conv); - NodeAnnouncement_set_contents(&this_ptr_conv, val_conv); + ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) { - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKUnsignedNodeAnnouncement contents_arg_conv; - contents_arg_conv.inner = (void*)(contents_arg & (~1)); - contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); - contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); - LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, jboolean full_information_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33456,8 +35511,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn return ret_ref; } -static inline uintptr_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { - LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); +static inline uintptr_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33468,21 +35523,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeAnnouncement arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyShortChannelIdsEnd arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv); + int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeAnnouncement orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReplyShortChannelIdsEnd orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33494,168 +35549,87 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedChannelAnnouncement this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKGossipTimestampFilter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedChannelAnnouncement_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv); + GossipTimestampFilter_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref); + GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv); + int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form); - return ret_arr; + GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref); + int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form); - return ret_arr; + GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_timestamp_arg, int32_t timestamp_range_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline uintptr_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { - LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); +static inline uintptr_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33666,21 +35640,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedChannelAnnouncement arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKGossipTimestampFilter arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); + int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedChannelAnnouncement orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKGossipTimestampFilter orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33692,147 +35666,152 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelAnnouncement this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelAnnouncement_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr); + FREE((void*)this_ptr); + ErrorAction_free(this_ptr_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form); - return ret_arr; +static inline uintptr_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorAction* arg_conv = (LDKErrorAction*)arg; + int64_t ret_conv = ErrorAction_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKErrorAction* orig_conv = (LDKErrorAction*)orig; + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) { + LDKErrorMessage msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ErrorMessage_clone(&msg_conv); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_disconnect_peer(msg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_ignore_error(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) { + LDKLevel a_conv = LDKLevel_from_java(env, a); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_ignore_and_log(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_ignore_duplicate_gossip(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) { + LDKErrorMessage msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ErrorMessage_clone(&msg_conv); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_send_error_message(msg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1warning_1message(JNIEnv *env, jclass clz, int64_t msg, jclass log_level) { + LDKWarningMessage msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = WarningMessage_clone(&msg_conv); + LDKLevel log_level_conv = LDKLevel_from_java(env, log_level); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKLightningError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + LightningError_free(this_obj_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form); - return ret_arr; + LDKStr ret_str = LightningError_get_err(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref); + LDKStr val_conv = java_to_owned_str(env, val); + LightningError_set_err(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = LightningError_get_action(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedChannelAnnouncement val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UnsignedChannelAnnouncement_clone(&val_conv); - ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); + val_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)val) & ~1)); + LightningError_set_action(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray node_signature_1_arg, int8_tArray node_signature_2_arg, int8_tArray bitcoin_signature_1_arg, int8_tArray bitcoin_signature_2_arg, int64_t contents_arg) { - LDKSignature node_signature_1_arg_ref; - CHECK((*env)->GetArrayLength(env, node_signature_1_arg) == 64); - (*env)->GetByteArrayRegion(env, node_signature_1_arg, 0, 64, node_signature_1_arg_ref.compact_form); - LDKSignature node_signature_2_arg_ref; - CHECK((*env)->GetArrayLength(env, node_signature_2_arg) == 64); - (*env)->GetByteArrayRegion(env, node_signature_2_arg, 0, 64, node_signature_2_arg_ref.compact_form); - LDKSignature bitcoin_signature_1_arg_ref; - CHECK((*env)->GetArrayLength(env, bitcoin_signature_1_arg) == 64); - (*env)->GetByteArrayRegion(env, bitcoin_signature_1_arg, 0, 64, bitcoin_signature_1_arg_ref.compact_form); - LDKSignature bitcoin_signature_2_arg_ref; - CHECK((*env)->GetArrayLength(env, bitcoin_signature_2_arg) == 64); - (*env)->GetByteArrayRegion(env, bitcoin_signature_2_arg, 0, 64, bitcoin_signature_2_arg_ref.compact_form); - LDKUnsignedChannelAnnouncement contents_arg_conv; - contents_arg_conv.inner = (void*)(contents_arg & (~1)); - contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); - contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); - LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) { + LDKStr err_arg_conv = java_to_owned_str(env, err_arg); + void* action_arg_ptr = (void*)(((uintptr_t)action_arg) & ~1); + CHECK_ACCESS(action_arg_ptr); + LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr); + action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)action_arg) & ~1)); + LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33844,8 +35823,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN return ret_ref; } -static inline uintptr_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { - LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); +static inline uintptr_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { + LDKLightningError ret_var = LightningError_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33856,21 +35835,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelAnnouncement arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKLightningError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv); + int64_t ret_conv = LightningError_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelAnnouncement orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKLightningError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); + LDKLightningError ret_var = LightningError_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33882,227 +35861,256 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone( return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedChannelUpdate this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedChannelUpdate_free(this_obj_conv); + CommitmentUpdate_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv)); + LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p]; + int64_t ret_conv_15_ref = 0; + CHECK((((uintptr_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); + ret_conv_15_ref = (uintptr_t)ret_conv_15_var.inner; + if (ret_conv_15_var.is_owned) { + ret_conv_15_ref |= 1; + } + ret_arr_ptr[p] = ret_conv_15_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); -} - -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; + LDKCVec_UpdateAddHTLCZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t p = 0; p < val_constr.datalen; p++) { + int64_t val_conv_15 = val_vals[p]; + LDKUpdateAddHTLC val_conv_15_conv; + val_conv_15_conv.inner = (void*)(val_conv_15 & (~1)); + val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); + val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); + val_constr.data[p] = val_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); + LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t t = 0; t < ret_var.datalen; t++) { + LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t]; + int64_t ret_conv_19_ref = 0; + CHECK((((uintptr_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); + ret_conv_19_ref = (uintptr_t)ret_conv_19_var.inner; + if (ret_conv_19_var.is_owned) { + ret_conv_19_ref |= 1; + } + ret_arr_ptr[t] = ret_conv_19_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_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + LDKCVec_UpdateFulfillHTLCZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t t = 0; t < val_constr.datalen; t++) { + int64_t val_conv_19 = val_vals[t]; + LDKUpdateFulfillHTLC val_conv_19_conv; + val_conv_19_conv.inner = (void*)(val_conv_19 & (~1)); + val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); + val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); + val_constr.data[t] = val_conv_19_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); + LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t q = 0; q < ret_var.datalen; q++) { + LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; + if (ret_conv_16_var.is_owned) { + ret_conv_16_ref |= 1; + } + ret_arr_ptr[q] = ret_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); - return ret_conv; + LDKCVec_UpdateFailHTLCZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t q = 0; q < val_constr.datalen; q++) { + int64_t val_conv_16 = val_vals[q]; + LDKUpdateFailHTLC val_conv_16_conv; + val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); + val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); + val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); + val_constr.data[q] = val_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); + LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t z = 0; z < ret_var.datalen; z++) { + LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z]; + int64_t ret_conv_25_ref = 0; + CHECK((((uintptr_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); + ret_conv_25_ref = (uintptr_t)ret_conv_25_var.inner; + if (ret_conv_25_var.is_owned) { + ret_conv_25_ref |= 1; + } + ret_arr_ptr[z] = ret_conv_25_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + LDKCVec_UpdateFailMalformedHTLCZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t z = 0; z < val_constr.datalen; z++) { + int64_t val_conv_25 = val_vals[z]; + LDKUpdateFailMalformedHTLC val_conv_25_conv; + val_conv_25_conv.inner = (void*)(val_conv_25 & (~1)); + val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); + val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); + val_constr.data[z] = val_conv_25_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); -} - -static inline uintptr_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedChannelUpdate arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedChannelUpdate orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); + LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelUpdate this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUpdate_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelUpdate_set_signature(&this_ptr_conv, val_ref); + LDKUpdateFee val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UpdateFee_clone(&val_conv); + CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdate this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); + LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34114,29 +36122,99 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1content return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedChannelUpdate val_conv; + LDKCommitmentSigned val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UnsignedChannelUpdate_clone(&val_conv); - ChannelUpdate_set_contents(&this_ptr_conv, val_conv); + val_conv = CommitmentSigned_clone(&val_conv); + CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) { - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKUnsignedChannelUpdate contents_arg_conv; - contents_arg_conv.inner = (void*)(contents_arg & (~1)); - contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); - contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); - LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEnv *env, jclass clz, int64_tArray update_add_htlcs_arg, int64_tArray update_fulfill_htlcs_arg, int64_tArray update_fail_htlcs_arg, int64_tArray update_fail_malformed_htlcs_arg, int64_t update_fee_arg, int64_t commitment_signed_arg) { + LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr; + update_add_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_add_htlcs_arg); + if (update_add_htlcs_arg_constr.datalen > 0) + update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); + else + update_add_htlcs_arg_constr.data = NULL; + int64_t* update_add_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_add_htlcs_arg, NULL); + for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { + int64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p]; + LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; + update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1)); + update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); + update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); + update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0); + LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr; + update_fulfill_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fulfill_htlcs_arg); + if (update_fulfill_htlcs_arg_constr.datalen > 0) + update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); + else + update_fulfill_htlcs_arg_constr.data = NULL; + int64_t* update_fulfill_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fulfill_htlcs_arg, NULL); + for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { + int64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t]; + LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; + update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1)); + update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); + update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); + update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; + } + (*env)->ReleaseLongArrayElements(env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0); + LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr; + update_fail_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_htlcs_arg); + if (update_fail_htlcs_arg_constr.datalen > 0) + update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); + else + update_fail_htlcs_arg_constr.data = NULL; + int64_t* update_fail_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_htlcs_arg, NULL); + for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { + int64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q]; + LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; + update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1)); + update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); + update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); + update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0); + LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr; + update_fail_malformed_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_malformed_htlcs_arg); + if (update_fail_malformed_htlcs_arg_constr.datalen > 0) + update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); + else + update_fail_malformed_htlcs_arg_constr.data = NULL; + int64_t* update_fail_malformed_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_malformed_htlcs_arg, NULL); + for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { + int64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; + LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; + update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1)); + update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); + update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); + update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; + } + (*env)->ReleaseLongArrayElements(env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0); + LDKUpdateFee update_fee_arg_conv; + update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); + update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); + update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); + LDKCommitmentSigned commitment_signed_arg_conv; + commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); + commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); + commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); + LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34148,8 +36226,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * return ret_ref; } -static inline uintptr_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { - LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); +static inline uintptr_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34160,21 +36238,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelUpdate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelUpdate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCommitmentUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34186,805 +36264,778 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKQueryChannelRange this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - QueryChannelRange_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv)); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr); + FREE((void*)this_ptr); + ChannelMessageHandler_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr); + FREE((void*)this_ptr); + RoutingMessageHandler_free(this_ptr_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKAcceptChannel obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_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_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = AcceptChannel_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKAnnouncementSignatures obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_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_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = AnnouncementSignatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelReestablish obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { - LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKQueryChannelRange arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_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_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = ChannelReestablish_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKQueryChannelRange orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKClosingSigned obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKReplyChannelRange this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReplyChannelRange_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_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_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = ClosingSigned_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKClosingSignedFeeRange obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_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_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = ClosingSignedFeeRange_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCommitmentSigned obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_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_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CommitmentSigned_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFundingCreated obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_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_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = FundingCreated_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFundingSigned obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_u64Z val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_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_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = FundingSigned_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg, jboolean sync_complete_arg, int64_tArray short_channel_ids_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKCVec_u64Z short_channel_ids_arg_constr; - short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg); - if (short_channel_ids_arg_constr.datalen > 0) - short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL); - for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { - int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g]; - short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6; - } - (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0); - LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelReady obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { - LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKReplyChannelRange arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_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_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = ChannelReady_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKReplyChannelRange orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInit obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = Init_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKQueryShortChannelIds this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - QueryShortChannelIds_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_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_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = Init_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryShortChannelIds this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOpenChannel obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryShortChannelIds_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKQueryShortChannelIds this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_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_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = OpenChannel_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKQueryShortChannelIds this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_u64Z val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRevokeAndACK obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryShortChannelIds_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKCVec_u64Z short_channel_ids_arg_constr; - short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg); - if (short_channel_ids_arg_constr.datalen > 0) - short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL); - for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { - int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g]; - short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6; - } - (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0); - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_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_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = RevokeAndACK_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -static inline uintptr_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKShutdown obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKQueryShortChannelIds arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_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_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = Shutdown_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKQueryShortChannelIds orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateFailHTLC obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKReplyShortChannelIdsEnd this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReplyShortChannelIdsEnd_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_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_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = UpdateFailHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateFailMalformedHTLC obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_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_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); + *ret_conv = UpdateFailMalformedHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateFee obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_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_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); + *ret_conv = UpdateFee_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, jboolean full_information_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateFulfillHTLC obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_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_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); + *ret_conv = UpdateFulfillHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } - return ret_ref; + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateAddHTLC obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKReplyShortChannelIdsEnd arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_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_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); + *ret_conv = UpdateAddHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKReplyShortChannelIdsEnd orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPing obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = Ping_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKGossipTimestampFilter this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - GossipTimestampFilter_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_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_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = Ping_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPong obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = Pong_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_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_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = Pong_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedChannelAnnouncement obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_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_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = UnsignedChannelAnnouncement_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelAnnouncement obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_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_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); + *ret_conv = ChannelAnnouncement_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_timestamp_arg, int32_t timestamp_range_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedChannelUpdate obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_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_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = UnsignedChannelUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } - return ret_ref; + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelUpdate obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKGossipTimestampFilter arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_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_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); + *ret_conv = ChannelUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKGossipTimestampFilter orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKErrorMessage obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr); - FREE((void*)this_ptr); - ErrorAction_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_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_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = ErrorMessage_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -static inline uintptr_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKWarningMessage obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKErrorAction* arg_conv = (LDKErrorAction*)arg; - int64_t ret_conv = ErrorAction_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_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_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ"); + *ret_conv = WarningMessage_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKErrorAction* orig_conv = (LDKErrorAction*)orig; - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedNodeAnnouncement obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) { - LDKErrorMessage msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = (msg & 1) || (msg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ErrorMessage_clone(&msg_conv); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_disconnect_peer(msg_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_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_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = UnsignedNodeAnnouncement_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) { - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_ignore_error(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeAnnouncement obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) { - LDKLevel a_conv = LDKLevel_from_java(env, a); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_ignore_and_log(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_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_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); + *ret_conv = NodeAnnouncement_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) { - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_ignore_duplicate_gossip(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_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_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = QueryShortChannelIds_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) { - LDKErrorMessage msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = (msg & 1) || (msg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ErrorMessage_clone(&msg_conv); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_send_error_message(msg_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKQueryShortChannelIds obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1send_1warning_1message(JNIEnv *env, jclass clz, int64_t msg, jclass log_level) { - LDKWarningMessage msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = (msg & 1) || (msg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = WarningMessage_clone(&msg_conv); - LDKLevel log_level_conv = LDKLevel_from_java(env, log_level); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKReplyShortChannelIdsEnd obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKLightningError this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - LightningError_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_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_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = LightningError_get_err(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKQueryChannelRange this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - LightningError_set_err(&this_ptr_conv, val_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKQueryChannelRange obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_LightningError_1get_1action(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = LightningError_get_action(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_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_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = QueryChannelRange_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); - val_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)val) & ~1)); - LightningError_set_action(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_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_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = ReplyChannelRange_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) { - LDKStr err_arg_conv = java_to_owned_str(env, err_arg); - void* action_arg_ptr = (void*)(((uintptr_t)action_arg) & ~1); - CHECK_ACCESS(action_arg_ptr); - LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr); - action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)action_arg) & ~1)); - LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKReplyChannelRange obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { - LDKLightningError ret_var = LightningError_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKGossipTimestampFilter obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } - return ret_ref; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_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_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = GossipTimestampFilter_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKLightningError arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = LightningError_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr); + FREE((void*)this_ptr); + CustomMessageHandler_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKLightningError orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKLightningError ret_var = LightningError_clone(&orig_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKIgnoringMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + IgnoringMessageHandler_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) { + LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34996,256 +37047,161 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEn return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCommitmentUpdate this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CommitmentUpdate_free(this_obj_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t p = 0; p < ret_var.datalen; p++) { - LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p]; - int64_t ret_conv_15_ref = 0; - CHECK((((uintptr_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); - ret_conv_15_ref = (uintptr_t)ret_conv_15_var.inner; - if (ret_conv_15_var.is_owned) { - ret_conv_15_ref |= 1; - } - ret_arr_ptr[p] = ret_conv_15_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateAddHTLCZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t p = 0; p < val_constr.datalen; p++) { - int64_t val_conv_15 = val_vals[p]; - LDKUpdateAddHTLC val_conv_15_conv; - val_conv_15_conv.inner = (void*)(val_conv_15 & (~1)); - val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); - val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); - val_constr.data[p] = val_conv_15_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t t = 0; t < ret_var.datalen; t++) { - LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t]; - int64_t ret_conv_19_ref = 0; - CHECK((((uintptr_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); - ret_conv_19_ref = (uintptr_t)ret_conv_19_var.inner; - if (ret_conv_19_var.is_owned) { - ret_conv_19_ref |= 1; - } - ret_arr_ptr[t] = ret_conv_19_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_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); + *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFulfillHTLCZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t t = 0; t < val_constr.datalen; t++) { - int64_t val_conv_19 = val_vals[t]; - LDKUpdateFulfillHTLC val_conv_19_conv; - val_conv_19_conv.inner = (void*)(val_conv_19 & (~1)); - val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); - val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); - val_constr.data[t] = val_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t q = 0; q < ret_var.datalen; q++) { - LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; - if (ret_conv_16_var.is_owned) { - ret_conv_16_ref |= 1; - } - ret_arr_ptr[q] = ret_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKErroringMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErroringMessageHandler_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFailHTLCZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t q = 0; q < val_constr.datalen; q++) { - int64_t val_conv_16 = val_vals[q]; - LDKUpdateFailHTLC val_conv_16_conv; - val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); - val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); - val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); - val_constr.data[q] = val_conv_16_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) { + LDKErroringMessageHandler ret_var = ErroringMessageHandler_new(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr); + return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t z = 0; z < ret_var.datalen; z++) { - LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z]; - int64_t ret_conv_25_ref = 0; - CHECK((((uintptr_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); - ret_conv_25_ref = (uintptr_t)ret_conv_25_var.inner; - if (ret_conv_25_var.is_owned) { - ret_conv_25_ref |= 1; - } - ret_arr_ptr[z] = ret_conv_25_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_ErroringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKErroringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKErroringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); + *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MessageHandler_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFailMalformedHTLCZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t z = 0; z < val_constr.datalen; z++) { - int64_t val_conv_25 = val_vals[z]; - LDKUpdateFailMalformedHTLC val_conv_25_conv; - val_conv_25_conv.inner = (void*)(val_conv_25 & (~1)); - val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); - val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); - val_constr.data[z] = val_conv_25_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); - int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); + if (val_conv.free == LDKChannelMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChannelMessageHandler_JCalls_cloned(&val_conv); } - return ret_ref; + MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKCommitmentUpdate this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUpdateFee val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UpdateFee_clone(&val_conv); - CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); + if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRoutingMessageHandler_JCalls_cloned(&val_conv); + } + MessageHandler_set_route_handler(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv *env, jclass clz, int64_t chan_handler_arg, int64_t route_handler_arg) { + void* chan_handler_arg_ptr = (void*)(((uintptr_t)chan_handler_arg) & ~1); + CHECK_ACCESS(chan_handler_arg_ptr); + LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr); + if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv); + } + void* route_handler_arg_ptr = (void*)(((uintptr_t)route_handler_arg) & ~1); + CHECK_ACCESS(route_handler_arg_ptr); + LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr); + if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv); + } + LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -35257,99 +37213,64 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1comm return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKCommitmentUpdate this_ptr_conv; +static inline uintptr_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(arg); + return (int64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; + int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); + if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } + LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr; + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(orig_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr); + FREE((void*)this_ptr); + SocketDescriptor_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPeerHandleError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PeerHandleError_free(this_obj_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCommitmentSigned val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = CommitmentSigned_clone(&val_conv); - CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); + jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEnv *env, jclass clz, int64_tArray update_add_htlcs_arg, int64_tArray update_fulfill_htlcs_arg, int64_tArray update_fail_htlcs_arg, int64_tArray update_fail_malformed_htlcs_arg, int64_t update_fee_arg, int64_t commitment_signed_arg) { - LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr; - update_add_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_add_htlcs_arg); - if (update_add_htlcs_arg_constr.datalen > 0) - update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); - else - update_add_htlcs_arg_constr.data = NULL; - int64_t* update_add_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_add_htlcs_arg, NULL); - for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { - int64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p]; - LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; - update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1)); - update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); - update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); - update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; - } - (*env)->ReleaseLongArrayElements(env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0); - LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr; - update_fulfill_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fulfill_htlcs_arg); - if (update_fulfill_htlcs_arg_constr.datalen > 0) - update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); - else - update_fulfill_htlcs_arg_constr.data = NULL; - int64_t* update_fulfill_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fulfill_htlcs_arg, NULL); - for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { - int64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t]; - LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; - update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1)); - update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); - update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); - update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0); - LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr; - update_fail_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_htlcs_arg); - if (update_fail_htlcs_arg_constr.datalen > 0) - update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); - else - update_fail_htlcs_arg_constr.data = NULL; - int64_t* update_fail_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_htlcs_arg, NULL); - for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { - int64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q]; - LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; - update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1)); - update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); - update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); - update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0); - LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr; - update_fail_malformed_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_malformed_htlcs_arg); - if (update_fail_malformed_htlcs_arg_constr.datalen > 0) - update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); - else - update_fail_malformed_htlcs_arg_constr.data = NULL; - int64_t* update_fail_malformed_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_malformed_htlcs_arg, NULL); - for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { - int64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; - LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; - update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1)); - update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); - update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); - update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; - } - (*env)->ReleaseLongArrayElements(env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0); - LDKUpdateFee update_fee_arg_conv; - update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); - update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); - update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); - LDKCommitmentSigned commitment_signed_arg_conv; - commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); - commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); - commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); - LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKPeerHandleError this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz, jboolean no_connection_possible_arg) { + LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -35361,8 +37282,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn return ret_ref; } -static inline uintptr_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { - LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); +static inline uintptr_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { + LDKPeerHandleError ret_var = PeerHandleError_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -35373,21 +37294,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCommitmentUpdate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPeerHandleError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCommitmentUpdate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPeerHandleError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); + LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -35399,778 +37320,1110 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr); - FREE((void*)this_ptr); - ChannelMessageHandler_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPeerManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PeerManager_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr); - FREE((void*)this_ptr); - RoutingMessageHandler_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) { + LDKMessageHandler message_handler_conv; + message_handler_conv.inner = (void*)(message_handler & (~1)); + message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv); + // WARNING: we need a move here but no clone is available for LDKMessageHandler + LDKSecretKey our_node_secret_ref; + CHECK((*env)->GetArrayLength(env, our_node_secret) == 32); + (*env)->GetByteArrayRegion(env, our_node_secret, 0, 32, our_node_secret_ref.bytes); + unsigned char ephemeral_random_data_arr[32]; + CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32); + (*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr); + unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr; + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* custom_message_handler_ptr = (void*)(((uintptr_t)custom_message_handler) & ~1); + CHECK_ACCESS(custom_message_handler_ptr); + LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr); + if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv); + } + LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKAcceptChannel obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_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_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); - *ret_conv = AcceptChannel_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t descriptor, int64_t remote_network_address) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + 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); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); + CHECK_ACCESS(descriptor_ptr); + LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); + if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); + } + void* remote_network_address_ptr = (void*)(((uintptr_t)remote_network_address) & ~1); + CHECK_ACCESS(remote_network_address_ptr); + LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKAnnouncementSignatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_PeerManager_1new_1inbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor, int64_t remote_network_address) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); + CHECK_ACCESS(descriptor_ptr); + LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); + if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); + } + void* remote_network_address_ptr = (void*)(((uintptr_t)remote_network_address) & ~1); + CHECK_ACCESS(remote_network_address_ptr); + LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_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_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); - *ret_conv = AnnouncementSignatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); + if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelReestablish obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t peer_descriptor, int8_tArray data) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* peer_descriptor_ptr = (void*)(((uintptr_t)peer_descriptor) & ~1); + if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } + LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; + LDKu8slice data_ref; + data_ref.datalen = (*env)->GetArrayLength(env, data); + data_ref.data = (*env)->GetByteArrayElements (env, data, NULL); + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); + (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + PeerManager_process_events(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); + if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; + PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id, jboolean no_connection_possible) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + PeerManager_disconnect_all_peers(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + PeerManager_timer_tick_occurred(&this_arg_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) { + int64_t ret_conv = htlc_success_tx_weight(opt_anchors); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) { + int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) { + unsigned char commitment_seed_arr[32]; + CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); + (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_arr); + unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1closing_1transaction(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) { + LDKCVec_u8Z to_holder_script_ref; + to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script); + to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data); + LDKCVec_u8Z to_counterparty_script_ref; + to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script); + to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data); + LDKOutPoint funding_outpoint_conv; + funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); + funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); + funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); + LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); + Transaction_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_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_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); - *ret_conv = ChannelReestablish_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCounterpartyCommitmentSecrets this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CounterpartyCommitmentSecrets_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKClosingSigned obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +static inline uintptr_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) { + LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_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_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); - *ret_conv = ClosingSigned_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyCommitmentSecrets arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKClosingSignedFeeRange obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyCommitmentSecrets_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCounterpartyCommitmentSecrets orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_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_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); - *ret_conv = ClosingSignedFeeRange_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1new(JNIEnv *env, jclass clz) { + LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCommitmentSigned obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyCommitmentSecrets_1get_1min_1seen_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCounterpartyCommitmentSecrets this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_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_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); - *ret_conv = CommitmentSigned_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1provide_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx, int8_tArray secret) { + LDKCounterpartyCommitmentSecrets this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKThirtyTwoBytes secret_ref; + CHECK((*env)->GetArrayLength(env, secret) == 32); + (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_ref.data); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFundingCreated obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { + LDKCounterpartyCommitmentSecrets this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_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_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); - *ret_conv = FundingCreated_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFundingSigned obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCounterpartyCommitmentSecrets obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); + LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_FundingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_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_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); - *ret_conv = FundingSigned_read(ser_ref); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFundingLocked obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_derive_1private_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_secret) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + unsigned char base_secret_arr[32]; + CHECK((*env)->GetArrayLength(env, base_secret) == 32); + (*env)->GetByteArrayRegion(env, base_secret, 0, 32, base_secret_arr); + unsigned char (*base_secret_ref)[32] = &base_secret_arr; + LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); + *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_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_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = FundingLocked_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_point) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKPublicKey base_point_ref; + CHECK((*env)->GetArrayLength(env, base_point) == 33); + (*env)->GetByteArrayRegion(env, base_point, 0, 33, base_point_ref.compressed_form); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInit obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Init_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_derive_1private_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_secret, int8_tArray countersignatory_revocation_base_secret) { + unsigned char per_commitment_secret_arr[32]; + CHECK((*env)->GetArrayLength(env, per_commitment_secret) == 32); + (*env)->GetByteArrayRegion(env, per_commitment_secret, 0, 32, per_commitment_secret_arr); + unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr; + unsigned char countersignatory_revocation_base_secret_arr[32]; + CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_secret) == 32); + (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr); + unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr; + LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); + *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_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_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); - *ret_conv = Init_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray countersignatory_revocation_base_point) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKPublicKey countersignatory_revocation_base_point_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_point) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOpenChannel obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTxCreationKeys this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TxCreationKeys_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_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_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); - *ret_conv = OpenChannel_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRevokeAndACK obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_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_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); - *ret_conv = RevokeAndACK_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKShutdown obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_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_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); - *ret_conv = Shutdown_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateFailHTLC obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_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_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); - *ret_conv = UpdateFailHTLC_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateFailMalformedHTLC obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_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_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); - *ret_conv = UpdateFailMalformedHTLC_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateFee obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_TxCreationKeys_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point_arg, int8_tArray revocation_key_arg, int8_tArray broadcaster_htlc_key_arg, int8_tArray countersignatory_htlc_key_arg, int8_tArray broadcaster_delayed_payment_key_arg) { + LDKPublicKey per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); + LDKPublicKey revocation_key_arg_ref; + CHECK((*env)->GetArrayLength(env, revocation_key_arg) == 33); + (*env)->GetByteArrayRegion(env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form); + LDKPublicKey broadcaster_htlc_key_arg_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_htlc_key_arg) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form); + LDKPublicKey countersignatory_htlc_key_arg_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_htlc_key_arg) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form); + LDKPublicKey broadcaster_delayed_payment_key_arg_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form); + LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_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_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); - *ret_conv = UpdateFee_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +static inline uintptr_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { + LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateFulfillHTLC obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxCreationKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_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_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); - *ret_conv = UpdateFulfillHTLC_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKTxCreationKeys orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateAddHTLC obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKTxCreationKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); + LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_UpdateAddHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_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_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); - *ret_conv = UpdateAddHTLC_read(ser_ref); + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = TxCreationKeys_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPing obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Ping_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelPublicKeys this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelPublicKeys_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_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_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); - *ret_conv = Ping_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPong obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Pong_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_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_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); - *ret_conv = Pong_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedChannelAnnouncement obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_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_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); - *ret_conv = UnsignedChannelAnnouncement_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelAnnouncement obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_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_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); - *ret_conv = ChannelAnnouncement_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedChannelUpdate obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_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_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); - *ret_conv = UnsignedChannelUpdate_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelUpdate obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv *env, jclass clz, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg) { + LDKPublicKey funding_pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); + LDKPublicKey revocation_basepoint_arg_ref; + CHECK((*env)->GetArrayLength(env, revocation_basepoint_arg) == 33); + (*env)->GetByteArrayRegion(env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form); + LDKPublicKey payment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form); + LDKPublicKey delayed_payment_basepoint_arg_ref; + CHECK((*env)->GetArrayLength(env, delayed_payment_basepoint_arg) == 33); + (*env)->GetByteArrayRegion(env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form); + LDKPublicKey htlc_basepoint_arg_ref; + CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33); + (*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form); + LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelPublicKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelPublicKeys orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelPublicKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_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_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); - *ret_conv = ChannelUpdate_read(ser_ref); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = ChannelPublicKeys_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKErrorMessage obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_TxCreationKeys_1derive_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray broadcaster_delayed_payment_base, int8_tArray broadcaster_htlc_base, int8_tArray countersignatory_revocation_base, int8_tArray countersignatory_htlc_base) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKPublicKey broadcaster_delayed_payment_base_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_base) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form); + LDKPublicKey broadcaster_htlc_base_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_htlc_base) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form); + LDKPublicKey countersignatory_revocation_base_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form); + LDKPublicKey countersignatory_htlc_base_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_htlc_base) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form); + LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); + *ret_conv = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_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_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); - *ret_conv = ErrorMessage_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1channel_1static_1keys(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int64_t broadcaster_keys, int64_t countersignatory_keys) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKChannelPublicKeys broadcaster_keys_conv; + broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); + broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); + LDKChannelPublicKeys countersignatory_keys_conv; + countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); + countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); + LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); + *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKWarningMessage obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv *env, jclass clz, int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) { + LDKPublicKey revocation_key_ref; + CHECK((*env)->GetArrayLength(env, revocation_key) == 33); + (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form); + LDKPublicKey broadcaster_delayed_payment_key_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); + LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_WarningMessage_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_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ"); - *ret_conv = WarningMessage_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHTLCOutputInCommitment this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HTLCOutputInCommitment_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedNodeAnnouncement obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_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_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); - *ret_conv = UnsignedNodeAnnouncement_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); + HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new(JNIEnv *env, jclass clz, jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t transaction_output_index_arg) { + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data); + void* transaction_output_index_arg_ptr = (void*)(((uintptr_t)transaction_output_index_arg) & ~1); + CHECK_ACCESS(transaction_output_index_arg_ptr); + LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr); + transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)transaction_output_index_arg) & ~1)); + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCOutputInCommitment arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCOutputInCommitment orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeAnnouncement obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); + LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_NodeAnnouncement_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_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); - *ret_conv = NodeAnnouncement_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_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_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); - *ret_conv = QueryShortChannelIds_read(ser_ref); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = HTLCOutputInCommitment_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKQueryShortChannelIds obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKReplyShortChannelIdsEnd obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv *env, jclass clz, int64_t htlc, jboolean opt_anchors, int64_t keys) { + LDKHTLCOutputInCommitment htlc_conv; + htlc_conv.inner = (void*)(htlc & (~1)); + htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); + LDKTxCreationKeys keys_conv; + keys_conv.inner = (void*)(keys & (~1)); + keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); + LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_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_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); - *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKQueryChannelRange this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKQueryChannelRange obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv *env, jclass clz, int8_tArray broadcaster, int8_tArray countersignatory) { + LDKPublicKey broadcaster_ref; + CHECK((*env)->GetArrayLength(env, broadcaster) == 33); + (*env)->GetByteArrayRegion(env, broadcaster, 0, 33, broadcaster_ref.compressed_form); + LDKPublicKey countersignatory_ref; + CHECK((*env)->GetArrayLength(env, countersignatory) == 33); + (*env)->GetByteArrayRegion(env, countersignatory, 0, 33, countersignatory_ref.compressed_form); + LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryChannelRange_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_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); - *ret_conv = QueryChannelRange_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_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_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); - *ret_conv = ReplyChannelRange_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKReplyChannelRange obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { + unsigned char commitment_txid_arr[32]; + CHECK((*env)->GetArrayLength(env, commitment_txid) == 32); + (*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr); + unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr; + LDKHTLCOutputInCommitment htlc_conv; + htlc_conv.inner = (void*)(htlc & (~1)); + htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); + LDKPublicKey broadcaster_delayed_payment_key_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); + LDKPublicKey revocation_key_ref; + CHECK((*env)->GetArrayLength(env, revocation_key) == 33); + (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form); + LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); + Transaction_free(ret_var); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKGossipTimestampFilter obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) { + LDKPublicKey funding_pubkey_ref; + CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33); + (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form); + LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_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_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); - *ret_conv = GossipTimestampFilter_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr); - FREE((void*)this_ptr); - CustomMessageHandler_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKIgnoringMessageHandler this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - IgnoringMessageHandler_free(this_obj_conv); + ChannelTransactionParameters_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) { - LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36182,161 +38435,153 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelPublicKeys val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelPublicKeys_clone(&val_conv); + ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); - *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); - *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKErroringMessageHandler this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErroringMessageHandler_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) { - LDKErroringMessageHandler ret_var = ErroringMessageHandler_new(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKErroringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKErroringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); - *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMessageHandler this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MessageHandler_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCounterpartyChannelTransactionParameters val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); + ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; - return ret_ret; + LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); - if (val_conv.free == LDKChannelMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChannelMessageHandler_JCalls_cloned(&val_conv); - } - MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; - return ret_ret; + jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv)); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); - if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRoutingMessageHandler_JCalls_cloned(&val_conv); - } - MessageHandler_set_route_handler(&this_ptr_conv, val_conv); + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); + ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv *env, jclass clz, int64_t chan_handler_arg, int64_t route_handler_arg) { - void* chan_handler_arg_ptr = (void*)(((uintptr_t)chan_handler_arg) & ~1); - CHECK_ACCESS(chan_handler_arg_ptr); - LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr); - if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv); - } - void* route_handler_arg_ptr = (void*)(((uintptr_t)route_handler_arg) & ~1); - CHECK_ACCESS(route_handler_arg_ptr); - LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr); - if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv); - } - LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg, jclass opt_anchors_arg) { + LDKChannelPublicKeys holder_pubkeys_arg_conv; + holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); + holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv); + holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); + LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; + counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); + counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); + counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); + LDKOutPoint funding_outpoint_arg_conv; + funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); + funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv); + funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); + LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg); + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36348,64 +38593,106 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv return ret_ref; } -static inline uintptr_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { - LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); - *ret_ret = SocketDescriptor_clone(arg); - return (int64_t)ret_ret; +static inline uintptr_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); - if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } - LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; - int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv); - return ret_conv; + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); - if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } - LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr; - LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); - *ret_ret = SocketDescriptor_clone(orig_conv); - return (int64_t)ret_ret; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr); - FREE((void*)this_ptr); - SocketDescriptor_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelTransactionParameters orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPeerHandleError this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCounterpartyChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PeerHandleError_free(this_obj_conv); + CounterpartyChannelTransactionParameters_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPeerHandleError this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv); + LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelPublicKeys val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelPublicKeys_clone(&val_conv); + CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKPeerHandleError this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); + CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz, jboolean no_connection_possible_arg) { - LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t pubkeys_arg, int16_t selected_contest_delay_arg) { + LDKChannelPublicKeys pubkeys_arg_conv; + pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); + pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); + pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36417,8 +38704,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv return ret_ref; } -static inline uintptr_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { - LDKPeerHandleError ret_var = PeerHandleError_clone(arg); +static inline uintptr_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36429,21 +38716,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPeerHandleError arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyChannelTransactionParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv); + int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPeerHandleError orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCounterpartyChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36455,42 +38742,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPeerManager this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PeerManager_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) { - LDKMessageHandler message_handler_conv; - message_handler_conv.inner = (void*)(message_handler & (~1)); - message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv); - // WARNING: we need a move here but no clone is available for LDKMessageHandler - LDKSecretKey our_node_secret_ref; - CHECK((*env)->GetArrayLength(env, our_node_secret) == 32); - (*env)->GetByteArrayRegion(env, our_node_secret, 0, 32, our_node_secret_ref.bytes); - unsigned char ephemeral_random_data_arr[32]; - CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32); - (*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr); - unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr; - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* custom_message_handler_ptr = (void*)(((uintptr_t)custom_message_handler) & ~1); - CHECK_ACCESS(custom_message_handler_ptr); - LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr); - if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv); - } - LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36502,195 +38768,205 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en return ret_ref; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPeerManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - - FREE(ret_var.data); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCounterpartyChannelTransactionParameters obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_PeerManager_1new_1outbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t descriptor, int64_t remote_network_address) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - 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); - void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); - CHECK_ACCESS(descriptor_ptr); - LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); - if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); - } - void* remote_network_address_ptr = (void*)(((uintptr_t)remote_network_address) & ~1); - CHECK_ACCESS(remote_network_address_ptr); - LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor, int64_t remote_network_address) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); - CHECK_ACCESS(descriptor_ptr); - LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); - if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); - } - void* remote_network_address_ptr = (void*)(((uintptr_t)remote_network_address) & ~1); - CHECK_ACCESS(remote_network_address_ptr); - LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelTransactionParameters obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_PeerManager_1write_1buffer_1space_1avail(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); - if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_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_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = ChannelTransactionParameters_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t peer_descriptor, int8_tArray data) { - LDKPeerManager this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDirectedChannelTransactionParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DirectedChannelTransactionParameters_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* peer_descriptor_ptr = (void*)(((uintptr_t)peer_descriptor) & ~1); - if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } - LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; - LDKu8slice data_ref; - data_ref.datalen = (*env)->GetArrayLength(env, data); - data_ref.data = (*env)->GetByteArrayElements (env, data, NULL); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); - (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0); - return (int64_t)ret_conv; + LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPeerManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - PeerManager_process_events(&this_arg_conv); + LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) { - LDKPeerManager this_arg_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); - if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; - PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); + int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id, jboolean no_connection_possible) { - LDKPeerManager this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible); + jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPeerManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - PeerManager_disconnect_all_peers(&this_arg_conv); + LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPeerManager this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - PeerManager_timer_tick_occurred(&this_arg_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) { - int64_t ret_conv = htlc_success_tx_weight(opt_anchors); + jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) { - int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHolderCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HolderCommitmentTransaction_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) { - unsigned char commitment_seed_arr[32]; - CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); - (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_arr); - unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHolderCommitmentTransaction this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1closing_1transaction(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) { - LDKCVec_u8Z to_holder_script_ref; - to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script); - to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data); - LDKCVec_u8Z to_counterparty_script_ref; - to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script); - to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data); - LDKOutPoint funding_outpoint_conv; - funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); - funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); - funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); - LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Transaction_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHolderCommitmentTransaction this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCounterpartyCommitmentSecrets this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CounterpartyCommitmentSecrets_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { + LDKHolderCommitmentTransaction this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_SignatureZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + val_constr.data = NULL; + for (size_t i = 0; i < val_constr.datalen; i++) { + int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); + LDKSignature val_conv_8_ref; + CHECK((*env)->GetArrayLength(env, val_conv_8) == 64); + (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form); + val_constr.data[i] = val_conv_8_ref; + } + HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } -static inline uintptr_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) { - LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg); +static inline uintptr_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36701,34 +38977,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCounterpartyCommitmentSecrets arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHolderCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv); + int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCounterpartyCommitmentSecrets orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHolderCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1new(JNIEnv *env, jclass clz) { - LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new(); + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36737,244 +39000,135 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecre if (ret_var.is_owned) { ret_ref |= 1; } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1min_1seen_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCounterpartyCommitmentSecrets this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1provide_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx, int8_tArray secret) { - LDKCounterpartyCommitmentSecrets this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKThirtyTwoBytes secret_ref; - CHECK((*env)->GetArrayLength(env, secret) == 32); - (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_ref.data); - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { - LDKCounterpartyCommitmentSecrets this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCounterpartyCommitmentSecrets obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyCommitmentSecrets_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_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_secret) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - unsigned char base_secret_arr[32]; - CHECK((*env)->GetArrayLength(env, base_secret) == 32); - (*env)->GetByteArrayRegion(env, base_secret, 0, 32, base_secret_arr); - unsigned char (*base_secret_ref)[32] = &base_secret_arr; - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_point) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKPublicKey base_point_ref; - CHECK((*env)->GetArrayLength(env, base_point) == 33); - (*env)->GetByteArrayRegion(env, base_point, 0, 33, base_point_ref.compressed_form); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_secret, int8_tArray countersignatory_revocation_base_secret) { - unsigned char per_commitment_secret_arr[32]; - CHECK((*env)->GetArrayLength(env, per_commitment_secret) == 32); - (*env)->GetByteArrayRegion(env, per_commitment_secret, 0, 32, per_commitment_secret_arr); - unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr; - unsigned char countersignatory_revocation_base_secret_arr[32]; - CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_secret) == 32); - (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr); - unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr; - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray countersignatory_revocation_base_point) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKPublicKey countersignatory_revocation_base_point_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_point) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKTxCreationKeys this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TxCreationKeys_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHolderCommitmentTransaction obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_TxCreationKeys_1set_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = HolderCommitmentTransaction_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new(JNIEnv *env, jclass clz, int64_t commitment_tx, int8_tArray counterparty_sig, jobjectArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { + LDKCommitmentTransaction commitment_tx_conv; + commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); + commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); + commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); + LDKSignature counterparty_sig_ref; + CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64); + (*env)->GetByteArrayRegion(env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form); + LDKCVec_SignatureZ counterparty_htlc_sigs_constr; + counterparty_htlc_sigs_constr.datalen = (*env)->GetArrayLength(env, counterparty_htlc_sigs); + if (counterparty_htlc_sigs_constr.datalen > 0) + counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + counterparty_htlc_sigs_constr.data = NULL; + for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) { + int8_tArray counterparty_htlc_sigs_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i); + LDKSignature counterparty_htlc_sigs_conv_8_ref; + CHECK((*env)->GetArrayLength(env, counterparty_htlc_sigs_conv_8) == 64); + (*env)->GetByteArrayRegion(env, counterparty_htlc_sigs_conv_8, 0, 64, counterparty_htlc_sigs_conv_8_ref.compact_form); + counterparty_htlc_sigs_constr.data[i] = counterparty_htlc_sigs_conv_8_ref; + } + LDKPublicKey holder_funding_key_ref; + CHECK((*env)->GetArrayLength(env, holder_funding_key) == 33); + (*env)->GetByteArrayRegion(env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form); + LDKPublicKey counterparty_funding_key_ref; + CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33); + (*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form); + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBuiltCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BuiltCommitmentTransaction_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form); + LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&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); + Transaction_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); + LDKTransaction val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + val_ref.data_is_owned = true; + BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point_arg, int8_tArray revocation_key_arg, int8_tArray broadcaster_htlc_key_arg, int8_tArray countersignatory_htlc_key_arg, int8_tArray broadcaster_delayed_payment_key_arg) { - LDKPublicKey per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); - LDKPublicKey revocation_key_arg_ref; - CHECK((*env)->GetArrayLength(env, revocation_key_arg) == 33); - (*env)->GetByteArrayRegion(env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form); - LDKPublicKey broadcaster_htlc_key_arg_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_htlc_key_arg) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form); - LDKPublicKey countersignatory_htlc_key_arg_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_htlc_key_arg) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form); - LDKPublicKey broadcaster_delayed_payment_key_arg_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form); - LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new(JNIEnv *env, jclass clz, int8_tArray transaction_arg, int8_tArray txid_arg) { + LDKTransaction transaction_arg_ref; + transaction_arg_ref.datalen = (*env)->GetArrayLength(env, transaction_arg); + transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, transaction_arg, 0, transaction_arg_ref.datalen, transaction_arg_ref.data); + transaction_arg_ref.data_is_owned = true; + LDKThirtyTwoBytes txid_arg_ref; + CHECK((*env)->GetArrayLength(env, txid_arg) == 32); + (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data); + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36986,8 +39140,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv return ret_ref; } -static inline uintptr_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { - LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +static inline uintptr_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36998,21 +39152,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKTxCreationKeys arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBuiltCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv); + int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKTxCreationKeys orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBuiltCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37024,158 +39178,147 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEn return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKTxCreationKeys obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBuiltCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); + LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_TxCreationKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_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_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = TxCreationKeys_read(ser_ref); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = BuiltCommitmentTransaction_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelPublicKeys this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelPublicKeys_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKBuiltCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); + funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data); + (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKBuiltCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char funding_key_arr[32]; + CHECK((*env)->GetArrayLength(env, funding_key) == 32); + (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); + unsigned char (*funding_key_ref)[32] = &funding_key_arr; + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); + funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); + (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKClosingTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ClosingTransaction_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form); - return ret_arr; +static inline uintptr_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { + LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); + return ret_ref; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClosingTransaction orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKClosingTransaction o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + int64_t ret_conv = ClosingTransaction_hash(&o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) { + LDKCVec_u8Z to_holder_script_ref; + to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script); + to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data); + LDKCVec_u8Z to_counterparty_script_ref; + to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script); + to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data); + LDKOutPoint funding_outpoint_conv; + funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); + funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); + funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); + LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv *env, jclass clz, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg) { - LDKPublicKey funding_pubkey_arg_ref; - CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33); - (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); - LDKPublicKey revocation_basepoint_arg_ref; - CHECK((*env)->GetArrayLength(env, revocation_basepoint_arg) == 33); - (*env)->GetByteArrayRegion(env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form); - LDKPublicKey payment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, payment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form); - LDKPublicKey delayed_payment_basepoint_arg_ref; - CHECK((*env)->GetArrayLength(env, delayed_payment_basepoint_arg) == 33); - (*env)->GetByteArrayRegion(env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form); - LDKPublicKey htlc_basepoint_arg_ref; - CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33); - (*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form); - LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37187,8 +39330,123 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE return ret_ref; } -static inline uintptr_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { - LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_outpoint) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKOutPoint funding_outpoint_conv; + funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); + funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); + funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); + LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); + *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTrustedClosingTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TrustedClosingTransaction_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Transaction_free(ret_var); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKTrustedClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); + funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data); + (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKTrustedClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char funding_key_arr[32]; + CHECK((*env)->GetArrayLength(env, funding_key) == 32); + (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); + unsigned char (*funding_key_ref)[32] = &funding_key_arr; + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); + funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); + (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CommitmentTransaction_free(this_obj_conv); +} + +static inline uintptr_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37199,21 +39457,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelPublicKeys arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv); + int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelPublicKeys orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37225,53 +39483,90 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JN return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelPublicKeys obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); + LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelPublicKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_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_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = ChannelPublicKeys_read(ser_ref); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CommitmentTransaction_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray broadcaster_delayed_payment_base, int8_tArray broadcaster_htlc_base, int8_tArray countersignatory_revocation_base, int8_tArray countersignatory_htlc_base) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKPublicKey broadcaster_delayed_payment_base_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_base) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form); - LDKPublicKey broadcaster_htlc_base_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_htlc_base) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form); - LDKPublicKey countersignatory_revocation_base_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form); - LDKPublicKey countersignatory_htlc_base_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_htlc_base) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1channel_1static_1keys(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int64_t broadcaster_keys, int64_t countersignatory_keys) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters, int64_t broadcaster_keys, int64_t countersignatory_keys) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKDirectedChannelTransactionParameters channel_parameters_conv; + channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); + channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; @@ -37280,137 +39575,35 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1chann countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv *env, jclass clz, int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) { - LDKPublicKey revocation_key_ref; - CHECK((*env)->GetArrayLength(env, revocation_key) == 33); - (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form); - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); - LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKHTLCOutputInCommitment this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTrustedCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCOutputInCommitment_free(this_obj_conv); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); + TrustedCommitmentTransaction_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); - HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new(JNIEnv *env, jclass clz, jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t transaction_output_index_arg) { - LDKThirtyTwoBytes payment_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data); - void* transaction_output_index_arg_ptr = (void*)(((uintptr_t)transaction_output_index_arg) & ~1); - CHECK_ACCESS(transaction_output_index_arg_ptr); - LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr); - transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)transaction_output_index_arg) & ~1)); - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37422,33 +39615,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new return ret_ref; } -static inline uintptr_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHTLCOutputInCommitment arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHTLCOutputInCommitment orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37460,105 +39632,136 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clo return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHTLCOutputInCommitment obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_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_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = HTLCOutputInCommitment_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_base_key, int64_t channel_parameters) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char htlc_base_key_arr[32]; + CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); + (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr); + unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr; + LDKDirectedChannelTransactionParameters channel_parameters_conv; + channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); + channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv *env, jclass clz, int64_t htlc, jboolean opt_anchors, int64_t keys) { - LDKHTLCOutputInCommitment htlc_conv; - htlc_conv.inner = (void*)(htlc & (~1)); - htlc_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); - LDKTxCreationKeys keys_conv; - keys_conv.inner = (void*)(keys & (~1)); - keys_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); - LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_get_1commitment_1transaction_1number_1obscure_1factor(JNIEnv *env, jclass clz, int8_tArray broadcaster_payment_basepoint, int8_tArray countersignatory_payment_basepoint, jboolean outbound_from_broadcaster) { + LDKPublicKey broadcaster_payment_basepoint_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_payment_basepoint) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_payment_basepoint, 0, 33, broadcaster_payment_basepoint_ref.compressed_form); + LDKPublicKey countersignatory_payment_basepoint_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_payment_basepoint) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_payment_basepoint, 0, 33, countersignatory_payment_basepoint_ref.compressed_form); + int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv *env, jclass clz, int8_tArray broadcaster, int8_tArray countersignatory) { - LDKPublicKey broadcaster_ref; - CHECK((*env)->GetArrayLength(env, broadcaster) == 33); - (*env)->GetByteArrayRegion(env, broadcaster, 0, 33, broadcaster_ref.compressed_form); - LDKPublicKey countersignatory_ref; - CHECK((*env)->GetArrayLength(env, countersignatory) == 33); - (*env)->GetByteArrayRegion(env, countersignatory, 0, 33, countersignatory_ref.compressed_form); - LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInitFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKInitFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { - unsigned char commitment_txid_arr[32]; - CHECK((*env)->GetArrayLength(env, commitment_txid) == 32); - (*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr); - unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr; - LDKHTLCOutputInCommitment htlc_conv; - htlc_conv.inner = (void*)(htlc & (~1)); - htlc_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); - LDKPublicKey revocation_key_ref; - CHECK((*env)->GetArrayLength(env, revocation_key) == 33); - (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form); - LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Transaction_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKNodeFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) { - LDKPublicKey funding_pubkey_ref; - CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33); - (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form); - LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKChannelFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelTransactionParameters this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTransactionParameters_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInvoiceFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKInvoiceFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelTypeFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKChannelTypeFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uintptr_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInitFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInitFeatures orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37570,153 +39773,109 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelPublicKeys val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelPublicKeys_clone(&val_conv); - ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); - return ret_conv; +static inline uintptr_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeFeatures orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCounterpartyChannelTransactionParameters val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); - ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); +static inline uintptr_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelFeatures orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); +static inline uintptr_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv)); - return ret_conv; + return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); - ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg, jclass opt_anchors_arg) { - LDKChannelPublicKeys holder_pubkeys_arg_conv; - holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); - holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv); - holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); - LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; - counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); - counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); - counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); - LDKOutPoint funding_outpoint_arg_conv; - funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); - funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv); - funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); - LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg); - LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceFeatures orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37728,8 +39887,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -static inline uintptr_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { - LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); +static inline uintptr_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37740,21 +39899,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelTransactionParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelTypeFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelTransactionParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelTypeFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37766,20 +39925,48 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCounterpartyChannelTransactionParameters this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInitFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CounterpartyChannelTransactionParameters_free(this_obj_conv); + InitFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeFeatures_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelFeatures_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceFeatures_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelTypeFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelTypeFeatures_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInitFeatures ret_var = InitFeatures_empty(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37791,43 +39978,43 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKCounterpartyChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelPublicKeys val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelPublicKeys_clone(&val_conv); - CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv *env, jclass clz) { + LDKInitFeatures ret_var = InitFeatures_known(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKCounterpartyChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) { + LDKNodeFeatures ret_var = NodeFeatures_empty(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t pubkeys_arg, int16_t selected_contest_delay_arg) { - LDKChannelPublicKeys pubkeys_arg_conv; - pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); - pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); - pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); - LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv *env, jclass clz) { + LDKNodeFeatures ret_var = NodeFeatures_known(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37839,33 +40026,30 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact return ret_ref; } -static inline uintptr_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { - LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) { + LDKChannelFeatures ret_var = ChannelFeatures_empty(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCounterpartyChannelTransactionParameters arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCounterpartyChannelTransactionParameters orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIEnv *env, jclass clz) { + LDKChannelFeatures ret_var = ChannelFeatures_known(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37877,21 +40061,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv); + jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTransactionParameters this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_empty(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37903,12 +40083,30 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTransactionParameters this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_known(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); + jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37920,1469 +40118,1215 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCounterpartyChannelTransactionParameters obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInitFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); + 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_CounterpartyChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref); + 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 (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelTransactionParameters obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); + 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 (int64_t)ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeFeatures obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + 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 (int64_t)ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceFeatures obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_InvoiceFeatures_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_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = InvoiceFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelTypeFeatures obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + 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_ChannelTransactionParameters_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_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = ChannelTransactionParameters_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +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 (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_data_loss_protect_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_data_loss_protect_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_data_loss_protect_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDirectedChannelTransactionParameters this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DirectedChannelTransactionParameters_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_data_loss_protect_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv); + return ret_conv; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); - return ret_conv; + InitFeatures_set_initial_routing_sync_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + InitFeatures_set_initial_routing_sync_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv); + jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKHolderCommitmentTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HolderCommitmentTransaction_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_SignatureZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - val_constr.data = NULL; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); - LDKSignature val_conv_8_ref; - CHECK((*env)->GetArrayLength(env, val_conv_8) == 64); - (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form); - val_constr.data[i] = val_conv_8_ref; - } - HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); } -static inline uintptr_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHolderCommitmentTransaction arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHolderCommitmentTransaction orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHolderCommitmentTransaction obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = HolderCommitmentTransaction_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_gossip_queries_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new(JNIEnv *env, jclass clz, int64_t commitment_tx, int8_tArray counterparty_sig, jobjectArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { - LDKCommitmentTransaction commitment_tx_conv; - commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); - commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); - commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); - LDKSignature counterparty_sig_ref; - CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64); - (*env)->GetByteArrayRegion(env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form); - LDKCVec_SignatureZ counterparty_htlc_sigs_constr; - counterparty_htlc_sigs_constr.datalen = (*env)->GetArrayLength(env, counterparty_htlc_sigs); - if (counterparty_htlc_sigs_constr.datalen > 0) - counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - counterparty_htlc_sigs_constr.data = NULL; - for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) { - int8_tArray counterparty_htlc_sigs_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i); - LDKSignature counterparty_htlc_sigs_conv_8_ref; - CHECK((*env)->GetArrayLength(env, counterparty_htlc_sigs_conv_8) == 64); - (*env)->GetByteArrayRegion(env, counterparty_htlc_sigs_conv_8, 0, 64, counterparty_htlc_sigs_conv_8_ref.compact_form); - counterparty_htlc_sigs_constr.data[i] = counterparty_htlc_sigs_conv_8_ref; - } - LDKPublicKey holder_funding_key_ref; - CHECK((*env)->GetArrayLength(env, holder_funding_key) == 33); - (*env)->GetByteArrayRegion(env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form); - LDKPublicKey counterparty_funding_key_ref; - CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33); - (*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form); - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_gossip_queries_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBuiltCommitmentTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BuiltCommitmentTransaction_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBuiltCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&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); - Transaction_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_gossip_queries_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBuiltCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKTransaction val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - val_ref.data_is_owned = true; - BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_gossip_queries_required(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBuiltCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv)); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBuiltCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new(JNIEnv *env, jclass clz, int8_tArray transaction_arg, int8_tArray txid_arg) { - LDKTransaction transaction_arg_ref; - transaction_arg_ref.datalen = (*env)->GetArrayLength(env, transaction_arg); - transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, transaction_arg, 0, transaction_arg_ref.datalen, transaction_arg_ref.data); - transaction_arg_ref.data_is_owned = true; - LDKThirtyTwoBytes txid_arg_ref; - CHECK((*env)->GetArrayLength(env, txid_arg) == 32); - (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data); - LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv); + return ret_conv; } -static inline uintptr_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { - LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_variable_length_onion_optional(&this_arg_conv); } - return ret_ref; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_variable_length_onion_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBuiltCommitmentTransaction arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBuiltCommitmentTransaction orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_variable_length_onion_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBuiltCommitmentTransaction obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_variable_length_onion_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_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_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = BuiltCommitmentTransaction_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKBuiltCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); - funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data); - (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); - return ret_arr; + InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKBuiltCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char funding_key_arr[32]; - CHECK((*env)->GetArrayLength(env, funding_key) == 32); - (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); - unsigned char (*funding_key_ref)[32] = &funding_key_arr; - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); - funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); - (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); - return ret_arr; + InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKClosingTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClosingTransaction_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; } -static inline uintptr_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { - LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClosingTransaction arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClosingTransaction orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKClosingTransaction o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = ClosingTransaction_hash(&o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) { - LDKCVec_u8Z to_holder_script_ref; - to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script); - to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data); - LDKCVec_u8Z to_counterparty_script_ref; - to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script); - to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data); - LDKOutPoint funding_outpoint_conv; - funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); - funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); - funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); - LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_static_remote_key_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_outpoint) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint funding_outpoint_conv; - funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); - funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); - funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); - LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); - *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); - return (int64_t)ret_conv; + NodeFeatures_set_static_remote_key_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv); - return ret_conv; + NodeFeatures_set_static_remote_key_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; + ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; + ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKTrustedClosingTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TrustedClosingTransaction_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Transaction_free(ret_var); - return ret_arr; + jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKTrustedClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); - funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data); - (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); - return ret_arr; + jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKTrustedClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char funding_key_arr[32]; - CHECK((*env)->GetArrayLength(env, funding_key) == 32); - (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); - unsigned char (*funding_key_ref)[32] = &funding_key_arr; - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); - funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); - (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); - return ret_arr; + jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCommitmentTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CommitmentTransaction_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_payment_secret_optional(&this_arg_conv); } -static inline uintptr_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { - LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_payment_secret_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCommitmentTransaction arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCommitmentTransaction orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_payment_secret_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCommitmentTransaction obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_payment_secret_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_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_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CommitmentTransaction_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv); - return ret_conv; + InvoiceFeatures_set_payment_secret_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); + InvoiceFeatures_set_payment_secret_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); + jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv); return ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters, int64_t broadcaster_keys, int64_t countersignatory_keys) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKDirectedChannelTransactionParameters channel_parameters_conv; - channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); - channel_parameters_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); - LDKChannelPublicKeys broadcaster_keys_conv; - broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); - broadcaster_keys_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); - LDKChannelPublicKeys countersignatory_keys_conv; - countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); - countersignatory_keys_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); - LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); - *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); - return (int64_t)ret_conv; + InitFeatures_set_basic_mpp_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKTrustedCommitmentTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TrustedCommitmentTransaction_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_basic_mpp_required(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data); - return ret_arr; + jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + NodeFeatures_set_basic_mpp_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + NodeFeatures_set_basic_mpp_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_base_key, int64_t channel_parameters) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char htlc_base_key_arr[32]; - CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); - (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr); - unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr; - LDKDirectedChannelTransactionParameters channel_parameters_conv; - channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); - channel_parameters_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); - LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); - *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); - return (int64_t)ret_conv; + InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transaction_1number_1obscure_1factor(JNIEnv *env, jclass clz, int8_tArray broadcaster_payment_basepoint, int8_tArray countersignatory_payment_basepoint, jboolean outbound_from_broadcaster) { - LDKPublicKey broadcaster_payment_basepoint_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_payment_basepoint) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_payment_basepoint, 0, 33, broadcaster_payment_basepoint_ref.compressed_form); - LDKPublicKey countersignatory_payment_basepoint_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_payment_basepoint) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_payment_basepoint, 0, 33, countersignatory_payment_basepoint_ref.compressed_form); - int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInitFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKInitFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKNodeFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKChannelFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInvoiceFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKInvoiceFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelTypeFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKChannelTypeFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_wumbo_optional(&this_arg_conv); } -static inline uintptr_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { - LDKInitFeatures ret_var = InitFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_wumbo_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInitFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInitFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_wumbo_optional(&this_arg_conv); } -static inline uintptr_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { - LDKNodeFeatures ret_var = NodeFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_wumbo_required(&this_arg_conv); } - return ret_ref; + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv); + return ret_conv; } -static inline uintptr_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { - LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); } - return ret_ref; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); } -static inline uintptr_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { - LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -static inline uintptr_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } - return ret_ref; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_channel_type_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelTypeFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_channel_type_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelTypeFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInitFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InitFeatures_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_channel_type_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeFeatures_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_channel_type_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelFeatures_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceFeatures_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelTypeFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTypeFeatures_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) { - LDKInitFeatures ret_var = InitFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv *env, jclass clz) { - LDKInitFeatures ret_var = InitFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) { - LDKNodeFeatures ret_var = NodeFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv *env, jclass clz) { - LDKNodeFeatures ret_var = NodeFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) { - LDKChannelFeatures ret_var = ChannelFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIEnv *env, jclass clz) { - LDKChannelFeatures ret_var = ChannelFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { - LDKInvoiceFeatures ret_var = InvoiceFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) { - LDKInvoiceFeatures ret_var = InvoiceFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known(JNIEnv *env, jclass clz) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInitFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - 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 void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = InitFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = ChannelFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - 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 void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = NodeFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInvoiceFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_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_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); - *ret_conv = InvoiceFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelTypeFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - 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 jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -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 (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_keysend_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_keysend_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv); + return ret_conv; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -39574,11 +41518,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh( } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) { + LDKu8slice program_ref; program_ref.datalen = (*env)->GetArrayLength(env, program); program_ref.data = (*env)->GetByteArrayElements (env, program, NULL); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = ShutdownScript_new_witness_program(version, program_ref); + *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref); (*env)->ReleaseByteArrayElements(env, program, (int8_t*)program_ref.data, 0); return (int64_t)ret_conv; } @@ -39771,44 +41716,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env NetworkGraph_free(this_obj_conv); } -static inline uintptr_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) { - LDKNetworkGraph ret_var = NetworkGraph_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNetworkGraph arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = NetworkGraph_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNetworkGraph orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKReadOnlyNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); @@ -39858,9 +41765,9 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1upd return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1closed(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) { LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_closed(short_channel_id, is_permanent); + *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -39894,25 +41801,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetGraphMsgHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); - *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNetGraphMsgHandler this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKP2PGossipSync this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NetGraphMsgHandler_free(this_obj_conv); + P2PGossipSync_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t chain_access, int64_t logger) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t chain_access, int64_t logger) { LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; @@ -39935,7 +41832,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(&network_graph_conv, chain_access_conv, logger_conv); + LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -39947,8 +41844,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain_1access(JNIEnv *env, jclass clz, int64_t this_arg, int64_t chain_access) { - LDKNetGraphMsgHandler this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1chain_1access(JNIEnv *env, jclass clz, int64_t this_arg, int64_t chain_access) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); @@ -39963,26 +41860,36 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain LDKAccess_JCalls_cloned(&chain_access_conv.some); } } - NetGraphMsgHandler_add_chain_access(&this_arg_conv, chain_access_conv); + P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetGraphMsgHandler this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); + *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv); + *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); return (int64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetGraphMsgHandler this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); + *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); return (int64_t)ret_ret; } @@ -40489,6 +42396,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv * return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info(JNIEnv *env, jclass clz, int64_t this_arg, int8_t channel_flags) { + LDKChannelInfo this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } + return ret_ref; +} + JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); @@ -40593,6 +42519,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1direct return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv); + return ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) { LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -41267,21 +43202,35 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNI return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); + CHECK_ACCESS(arg_ptr); + LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); + if (arg_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_conv); + } LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = NetworkGraph_read(ser_ref); + *ret_conv = NetworkGraph_read(ser_ref, arg_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, int8_tArray genesis_hash) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, int8_tArray genesis_hash, int64_t logger) { LDKThirtyTwoBytes genesis_hash_ref; CHECK((*env)->GetArrayLength(env, genesis_hash) == 32); (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_ref.data); - LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -41310,6 +43259,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JN return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -41388,15 +43356,36 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1from_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, jboolean is_permanent) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent); + LDKChannelFeatures features_conv; + features_conv.inner = (void*)(features & (~1)); + features_conv.is_owned = (features & 1) || (features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = ChannelFeatures_clone(&features_conv); + LDKPublicKey node_id_1_ref; + CHECK((*env)->GetArrayLength(env, node_id_1) == 33); + (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form); + LDKPublicKey node_id_2_ref; + CHECK((*env)->GetArrayLength(env, node_id_2) == 33); + (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray _node_id, jboolean is_permanent) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, jboolean is_permanent) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray _node_id, jboolean is_permanent) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; @@ -41404,7 +43393,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node(JNIEn LDKPublicKey _node_id_ref; CHECK((*env)->GetArrayLength(env, _node_id) == 33); (*env)->GetByteArrayRegion(env, _node_id, 0, 33, _node_id_ref.compressed_form); - NetworkGraph_fail_node(&this_arg_conv, _node_id_ref, is_permanent); + NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -42847,7 +44836,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv * return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t route_params, int64_t network, int64_tArray first_hops, int64_t logger, int64_t scorer, int8_tArray random_seed_bytes) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int8_tArray random_seed_bytes) { LDKPublicKey our_node_pubkey_ref; CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); @@ -42855,10 +44844,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc route_params_conv.inner = (void*)(route_params & (~1)); route_params_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - LDKNetworkGraph network_conv; - network_conv.inner = (void*)(network & (~1)); - network_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_conv); + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = (void*)(network_graph & (~1)); + network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -42894,11 +44883,52 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_conv, first_hops_ptr, logger_conv, scorer_conv, random_seed_bytes_ref); + *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, random_seed_bytes_ref); if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } return (int64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, jobjectArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); + (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); + LDKCVec_PublicKeyZ hops_constr; + hops_constr.datalen = (*env)->GetArrayLength(env, hops); + if (hops_constr.datalen > 0) + hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + hops_constr.data = NULL; + for (size_t i = 0; i < hops_constr.datalen; i++) { + int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i); + LDKPublicKey hops_conv_8_ref; + CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33); + (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form); + hops_constr.data[i] = hops_conv_8_ref; + } + LDKRouteParameters route_params_conv; + route_params_conv.inner = (void*)(route_params & (~1)); + route_params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = (void*)(network_graph & (~1)); + network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + unsigned char random_seed_bytes_arr[32]; + CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); + (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); + unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); + return (int64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); @@ -42925,6 +44955,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1fr MultiThreadedLockableScore_free(this_obj_conv); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMultiThreadedLockableScore obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) { void* score_ptr = (void*)(((uintptr_t)score) & ~1); CHECK_ACCESS(score_ptr); @@ -42945,200 +44987,77 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_ return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFixedPenaltyScorer this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FixedPenaltyScorer_free(this_obj_conv); -} - -static inline uintptr_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFixedPenaltyScorer arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFixedPenaltyScorer orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFixedPenaltyScorer obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKScorer this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelUsage this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Scorer_free(this_obj_conv); + ChannelUsage_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKScoringParameters this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ScoringParameters_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ScoringParameters_get_base_penalty_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val); + ChannelUsage_set_amount_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val); + ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1start_11024th(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ScoringParameters_get_overuse_penalty_start_1024th(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1start_11024th(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKScoringParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_overuse_penalty_start_1024th(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1msat_1per_11024th(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ScoringParameters_get_overuse_penalty_msat_per_1024th(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1msat_1per_11024th(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKScoringParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_overuse_penalty_msat_per_1024th(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv); - return ret_conv; + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); + val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)(((uintptr_t)val) & ~1)); + ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIEnv *env, jclass clz, int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int16_t overuse_penalty_start_1024th_arg, int64_t overuse_penalty_msat_per_1024th_arg, int64_t failure_penalty_half_life_arg) { - LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new(JNIEnv *env, jclass clz, int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { + void* effective_capacity_arg_ptr = (void*)(((uintptr_t)effective_capacity_arg) & ~1); + CHECK_ACCESS(effective_capacity_arg_ptr); + LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); + effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)(((uintptr_t)effective_capacity_arg) & ~1)); + LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43150,8 +45069,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIE return ret_ref; } -static inline uintptr_t ScoringParameters_clone_ptr(LDKScoringParameters *NONNULL_PTR arg) { - LDKScoringParameters ret_var = ScoringParameters_clone(arg); +static inline uintptr_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { + LDKChannelUsage ret_var = ChannelUsage_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43162,21 +45081,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKScoringParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUsage arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ScoringParameters_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKScoringParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelUsage orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKScoringParameters ret_var = ScoringParameters_clone(&orig_conv); + LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43188,48 +45107,41 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1clone(JN return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKScoringParameters obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFixedPenaltyScorer this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FixedPenaltyScorer_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_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_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = ScoringParameters_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +static inline uintptr_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1new(JNIEnv *env, jclass clz, int64_t params) { - LDKScoringParameters params_conv; - params_conv.inner = (void*)(params & (~1)); - params_conv.is_owned = (params & 1) || (params == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); - params_conv = ScoringParameters_clone(¶ms_conv); - LDKScorer ret_var = Scorer_new(params_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFixedPenaltyScorer arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env, jclass clz) { - LDKScorer ret_var = Scorer_default(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFixedPenaltyScorer orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43241,8 +45153,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default(JNIEnv *env, jclass clz) { - LDKScoringParameters ret_var = ScoringParameters_default(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43254,34 +45166,34 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default( return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKScorer this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = Scorer_as_Score(&this_arg_conv); + *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv); return (int64_t)ret_ret; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKScorer obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFixedPenaltyScorer obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Scorer_write(&obj_conv); + LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); - *ret_conv = Scorer_read(ser_ref); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } @@ -43421,7 +45333,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParamet return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JNIEnv *env, jclass clz, int64_t params, int64_t network_graph) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JNIEnv *env, jclass clz, int64_t params, int64_t network_graph, int64_t logger) { LDKProbabilisticScoringParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); @@ -43431,7 +45343,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JN network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43443,6 +45362,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JN return ret_ref; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1default(JNIEnv *env, jclass clz) { LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default(); int64_t ret_ref = 0; @@ -43478,7 +45405,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1wr return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); @@ -43491,8 +45418,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(J arg_b_conv.inner = (void*)(arg_b & (~1)); arg_b_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); + void* arg_c_ptr = (void*)(((uintptr_t)arg_c) & ~1); + CHECK_ACCESS(arg_c_ptr); + LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); + if (arg_c_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_c_conv); + } LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv); + *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } @@ -43530,28 +45464,6 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1d return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persist_1manager(JNIEnv *env, jclass clz, jstring data_dir, int64_t manager) { - LDKStr data_dir_conv = java_to_owned_str(env, data_dir); - LDKChannelManager manager_conv; - manager_conv.inner = (void*)(manager & (~1)); - manager_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(manager_conv); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = FilesystemPersister_persist_manager(data_dir_conv, &manager_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persist_1network_1graph(JNIEnv *env, jclass clz, jstring data_dir, int64_t network_graph) { - LDKStr data_dir_conv = java_to_owned_str(env, data_dir); - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = (void*)(network_graph & (~1)); - network_graph_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = FilesystemPersister_persist_network_graph(data_dir_conv, &network_graph_conv); - return (int64_t)ret_conv; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1channelmonitors(JNIEnv *env, jclass clz, int64_t this_arg, int64_t keys_manager) { LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -43569,16 +45481,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1 return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1as_1Persist(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKFilesystemPersister this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); - *ret_ret = FilesystemPersister_as_Persist(&this_arg_conv); - return (int64_t)ret_ret; -} - 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 = (void*)(this_obj & (~1)); @@ -43587,16 +45489,45 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIE BackgroundProcessor_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipSync_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); + LDKGossipSync this_ptr_conv = *(LDKGossipSync*)(this_ptr_ptr); FREE((void*)this_ptr); - Persister_free(this_ptr_conv); + GossipSync_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t net_graph_msg_handler, int64_t peer_manager, int64_t logger) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1p2_1p(JNIEnv *env, jclass clz, int64_t a) { + LDKP2PGossipSync a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync"); + *ret_copy = GossipSync_p2_p(&a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1rapid(JNIEnv *env, jclass clz, int64_t a) { + LDKRapidGossipSync a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync"); + *ret_copy = GossipSync_rapid(&a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1none(JNIEnv *env, jclass clz) { + LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync"); + *ret_copy = GossipSync_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { void* persister_ptr = (void*)(((uintptr_t)persister) & ~1); CHECK_ACCESS(persister_ptr); LDKPersister persister_conv = *(LDKPersister*)(persister_ptr); @@ -43619,10 +45550,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); - LDKNetGraphMsgHandler net_graph_msg_handler_conv; - net_graph_msg_handler_conv.inner = (void*)(net_graph_msg_handler & (~1)); - net_graph_msg_handler_conv.is_owned = (net_graph_msg_handler & 1) || (net_graph_msg_handler == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(net_graph_msg_handler_conv); + void* gossip_sync_ptr = (void*)(((uintptr_t)gossip_sync) & ~1); + CHECK_ACCESS(gossip_sync_ptr); + LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr); + // WARNING: we may need a move here but no clone is available for LDKGossipSync LDKPeerManager peer_manager_conv; peer_manager_conv.inner = (void*)(peer_manager & (~1)); peer_manager_conv.is_owned = false; @@ -43634,7 +45565,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, net_graph_msg_handler_conv, &peer_manager_conv, logger_conv); + LDKMultiThreadedLockableScore scorer_conv; + scorer_conv.inner = (void*)(scorer & (~1)); + scorer_conv.is_owned = (scorer & 1) || (scorer == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv); + LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -45761,101 +47696,59 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jcla Router_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRetryAttempts this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RetryAttempts_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); + FREE((void*)this_ptr); + Retry_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRetryAttempts this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = RetryAttempts_get_a(&this_ptr_conv); - return ret_conv; +static inline uintptr_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRetryAttempts this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - RetryAttempts_set_a(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRetry* arg_conv = (LDKRetry*)arg; + int64_t ret_conv = Retry_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv *env, jclass clz, int64_t a_arg) { - LDKRetryAttempts ret_var = RetryAttempts_new(a_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRetry* orig_conv = (LDKRetry*)orig; + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static inline uintptr_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg) { - LDKRetryAttempts ret_var = RetryAttempts_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int64_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_attempts(a); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRetryAttempts arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = RetryAttempts_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRetryAttempts orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKRetryAttempts ret_var = RetryAttempts_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_timeout(a); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRetryAttempts a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKRetryAttempts b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = RetryAttempts_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRetry* a_conv = (LDKRetry*)a; + LDKRetry* b_conv = (LDKRetry*)b; + jboolean ret_conv = Retry_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRetryAttempts o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = RetryAttempts_hash(&o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRetry* o_conv = (LDKRetry*)o; + int64_t ret_conv = Retry_hash(o_conv); return ret_conv; } @@ -45919,7 +47812,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1sending(JNIEn return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *env, jclass clz, int64_t payer, int64_t router, int64_t scorer, int64_t logger, int64_t event_handler, int64_t retry_attempts) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *env, jclass clz, int64_t payer, int64_t router, int64_t scorer, int64_t logger, int64_t event_handler, int64_t retry) { void* payer_ptr = (void*)(((uintptr_t)payer) & ~1); CHECK_ACCESS(payer_ptr); LDKPayer payer_conv = *(LDKPayer*)(payer_ptr); @@ -45952,12 +47845,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKEventHandler_JCalls_cloned(&event_handler_conv); } - LDKRetryAttempts retry_attempts_conv; - retry_attempts_conv.inner = (void*)(retry_attempts & (~1)); - retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_attempts_conv); - retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv); - LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_conv); + void* retry_ptr = (void*)(((uintptr_t)retry) & ~1); + CHECK_ACCESS(retry_ptr); + LDKRetry retry_conv = *(LDKRetry*)(retry_ptr); + retry_conv = Retry_clone((LDKRetry*)(((uintptr_t)retry) & ~1)); + LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -46035,18 +47927,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHand return (int64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, jstring description, int8_tArray payment_hash, int8_tArray payment_secret, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) { void* amt_msat_ptr = (void*)(((uintptr_t)amt_msat) & ~1); CHECK_ACCESS(amt_msat_ptr); LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)amt_msat) & ~1)); - LDKStr description_conv = java_to_owned_str(env, description); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKStr description_conv = java_to_owned_str(env, description); LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); if (phantom_route_hints_constr.datalen > 0) @@ -46073,26 +47962,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JN } LDKCurrency network_conv = LDKCurrency_from_java(env, network); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice(amt_msat_conv, description_conv, payment_hash_ref, payment_secret_ref, phantom_route_hints_constr, keys_manager_conv, network_conv); + *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, keys_manager_conv, network_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t description_hash, int8_tArray payment_hash, int8_tArray payment_secret, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) { void* amt_msat_ptr = (void*)(((uintptr_t)amt_msat) & ~1); CHECK_ACCESS(amt_msat_ptr); LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)amt_msat) & ~1)); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); LDKSha256 description_hash_conv; description_hash_conv.inner = (void*)(description_hash & (~1)); description_hash_conv.is_owned = (description_hash & 1) || (description_hash == 0); 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); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); if (phantom_route_hints_constr.datalen > 0) @@ -46119,11 +48005,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1w } LDKCurrency network_conv = LDKCurrency_from_java(env, network); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, description_hash_conv, payment_hash_ref, payment_secret_ref, phantom_route_hints_constr, keys_manager_conv, network_conv); + *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, keys_manager_conv, network_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; @@ -46142,11 +48028,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)amt_msat) & ~1)); LDKStr description_conv = java_to_owned_str(env, description); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv); + *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, int64_t description_hash) { +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 keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; @@ -46169,11 +48055,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); description_hash_conv = Sha256_clone(&description_hash_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv); + *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch) { +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 keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; @@ -46196,11 +48082,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); description_hash_conv = Sha256_clone(&description_hash_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch); + *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch) { +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 keys_manager, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; @@ -46219,7 +48105,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)amt_msat) & ~1)); LDKStr description_conv = java_to_owned_str(env, description); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs); return (int64_t)ret_conv; } @@ -46353,3 +48239,115 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str(JNIEnv *e return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRapidGossipSync this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RapidGossipSync_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = (void*)(network_graph & (~1)); + network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + LDKRapidGossipSync ret_var = RapidGossipSync_new(&network_graph_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1sync_1network_1graph_1with_1file_1path(JNIEnv *env, jclass clz, int64_t this_arg, jstring sync_path) { + LDKRapidGossipSync this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKStr sync_path_conv = java_to_owned_str(env, sync_path); + LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ"); + *ret_conv = RapidGossipSync_sync_network_graph_with_file_path(&this_arg_conv, sync_path_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1is_1initial_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRapidGossipSync this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = RapidGossipSync_is_initial_sync_complete(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr); + FREE((void*)this_ptr); + GraphSyncError_free(this_ptr_conv); +} + +static inline uintptr_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) { + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)arg; + int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)orig; + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1decode_1error(JNIEnv *env, jclass clz, int64_t a) { + LDKDecodeError a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = DecodeError_clone(&a_conv); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_decode_error(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1lightning_1error(JNIEnv *env, jclass clz, int64_t a) { + LDKLightningError a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = LightningError_clone(&a_conv); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_lightning_error(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray update_data) { + LDKRapidGossipSync this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice update_data_ref; + update_data_ref.datalen = (*env)->GetArrayLength(env, update_data); + update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL); + LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ"); + *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref); + (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0); + return (int64_t)ret_conv; +} + diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index 61f942e6..659a4d00 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -679,10 +679,12 @@ static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass case 2: return LDKSecp256k1Error_InvalidPublicKey; case 3: return LDKSecp256k1Error_InvalidSignature; case 4: return LDKSecp256k1Error_InvalidSecretKey; - case 5: return LDKSecp256k1Error_InvalidRecoveryId; - case 6: return LDKSecp256k1Error_InvalidTweak; - case 7: return LDKSecp256k1Error_TweakCheckFailed; + case 5: return LDKSecp256k1Error_InvalidSharedSecret; + case 6: return LDKSecp256k1Error_InvalidRecoveryId; + case 7: return LDKSecp256k1Error_InvalidTweak; case 8: return LDKSecp256k1Error_NotEnoughMemory; + case 9: return LDKSecp256k1Error_InvalidPublicKeySum; + case 10: return LDKSecp256k1Error_InvalidParityValue; } (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value."); abort(); // Unreachable, but will let the compiler know we don't return here @@ -693,10 +695,12 @@ static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidMessage = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSignature = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL; +static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL; -static jfieldID Secp256k1Error_LDKSecp256k1Error_TweakCheckFailed = NULL; static jfieldID Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL; +static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = NULL; +static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = NULL; JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jclass clz) { Secp256k1Error_class = (*env)->NewGlobalRef(env, clz); CHECK(Secp256k1Error_class != NULL); @@ -710,14 +714,18 @@ JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jcla CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSignature != NULL); Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey != NULL); + Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSharedSecret", "Lorg/ldk/enums/Secp256k1Error;"); + CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret != NULL); Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL); Secp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL); - Secp256k1Error_LDKSecp256k1Error_TweakCheckFailed = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_TweakCheckFailed", "Lorg/ldk/enums/Secp256k1Error;"); - CHECK(Secp256k1Error_LDKSecp256k1Error_TweakCheckFailed != NULL); Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/Secp256k1Error;"); CHECK(Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL); + Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKeySum", "Lorg/ldk/enums/Secp256k1Error;"); + CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum != NULL); + Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidParityValue", "Lorg/ldk/enums/Secp256k1Error;"); + CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidParityValue != NULL); } static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) { switch (val) { @@ -731,14 +739,18 @@ static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error va return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSignature); case LDKSecp256k1Error_InvalidSecretKey: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey); + case LDKSecp256k1Error_InvalidSharedSecret: + return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret); case LDKSecp256k1Error_InvalidRecoveryId: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId); case LDKSecp256k1Error_InvalidTweak: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidTweak); - case LDKSecp256k1Error_TweakCheckFailed: - return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_TweakCheckFailed); case LDKSecp256k1Error_NotEnoughMemory: return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory); + case LDKSecp256k1Error_InvalidPublicKeySum: + return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum); + case LDKSecp256k1Error_InvalidParityValue: + return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidParityValue); default: abort(); } } @@ -1895,191 +1907,70 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return ret_ref; } -static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return TxOut_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv); - return (int64_t)ret_ref; -} - -static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return AccessError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); - jclass ret_conv = LDKAccessError_to_java(env, CResult_TxOutAccessErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ - return owner->a; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); - int64_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv); - return ret_conv; -} - -static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ - return owner->b; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); - LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { - LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]); - } - return ret; -} -static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) { - LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ 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 inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(owner & ~1); - CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv); -} - -static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return ChannelMonitorUpdateErr_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(owner & ~1); - jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv)); - return ret_conv; -} - -static jclass LDKMonitorEvent_HTLCEvent_class = NULL; -static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL; -static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL; -static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL; -static jclass LDKMonitorEvent_UpdateCompleted_class = NULL; -static jmethodID LDKMonitorEvent_UpdateCompleted_meth = NULL; -static jclass LDKMonitorEvent_UpdateFailed_class = NULL; -static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) { - LDKMonitorEvent_HTLCEvent_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent")); - CHECK(LDKMonitorEvent_HTLCEvent_class != NULL); - LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "", "(J)V"); - CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL); - LDKMonitorEvent_CommitmentTxConfirmed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed")); - CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL); - LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "", "(J)V"); - CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL); - LDKMonitorEvent_UpdateCompleted_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted")); - CHECK(LDKMonitorEvent_UpdateCompleted_class != NULL); - LDKMonitorEvent_UpdateCompleted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateCompleted_class, "", "(JJ)V"); - CHECK(LDKMonitorEvent_UpdateCompleted_meth != NULL); - LDKMonitorEvent_UpdateFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed")); - CHECK(LDKMonitorEvent_UpdateFailed_class != NULL); - LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "", "(J)V"); - CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL); +static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; +static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; +static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; +static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { + LDKPaymentPurpose_InvoicePayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment")); + CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); + LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[B)V"); + CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); + LDKPaymentPurpose_SpontaneousPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment")); + CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); + LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); + CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); switch(obj->tag) { - case LDKMonitorEvent_HTLCEvent: { - LDKHTLCUpdate htlc_event_var = obj->htlc_event; - int64_t htlc_event_ref = 0; - CHECK((((uintptr_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); - htlc_event_ref = (uintptr_t)htlc_event_var.inner & ~1; - return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref); - } - case LDKMonitorEvent_CommitmentTxConfirmed: { - LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed; - int64_t commitment_tx_confirmed_ref = 0; - CHECK((((uintptr_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); - commitment_tx_confirmed_ref = (uintptr_t)commitment_tx_confirmed_var.inner & ~1; - return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref); - } - case LDKMonitorEvent_UpdateCompleted: { - LDKOutPoint funding_txo_var = obj->update_completed.funding_txo; - int64_t funding_txo_ref = 0; - CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); - funding_txo_ref = (uintptr_t)funding_txo_var.inner & ~1; - int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id; - return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, monitor_update_id_conv); + case LDKPaymentPurpose_InvoicePayment: { + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); + int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); + return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr); } - case LDKMonitorEvent_UpdateFailed: { - LDKOutPoint update_failed_var = obj->update_failed; - int64_t update_failed_ref = 0; - CHECK((((uintptr_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); - update_failed_ref = (uintptr_t)update_failed_var.inner & ~1; - return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref); + case LDKPaymentPurpose_SpontaneousPayment: { + int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); + return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); } default: abort(); } } -static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { - LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = MonitorEvent_clone(&orig->data[i]); - } - return ret; +static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return PaymentPurpose_clone(&*owner->contents.result); } -static jclass LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = NULL; -static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = NULL; -static jclass LDKCOption_C2Tuple_usizeTransactionZZ_None_class = NULL; -static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1usizeTransactionZZ_init (JNIEnv *env, jclass clz) { - LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some")); - CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_class != NULL); - LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth != NULL); - LDKCOption_C2Tuple_usizeTransactionZZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None")); - CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_class != NULL); - LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, "", "()V"); - CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_meth != NULL); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(owner & ~1); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeTransactionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)(ptr & ~1); - switch(obj->tag) { - case LDKCOption_C2Tuple_usizeTransactionZZ_Some: { - LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *some_conv = obj->some; - *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv); - return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth, ((int64_t)some_conv)); - } - case LDKCOption_C2Tuple_usizeTransactionZZ_None: { - return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, LDKCOption_C2Tuple_usizeTransactionZZ_None_meth); - } - default: abort(); + +static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } + return ret_ref; } + static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL; static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL; static jclass LDKClosureReason_HolderForceClosed_class = NULL; @@ -2233,8 +2124,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureRe static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL; static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL; -static jclass LDKNetworkUpdate_ChannelClosed_class = NULL; -static jmethodID LDKNetworkUpdate_ChannelClosed_meth = NULL; +static jclass LDKNetworkUpdate_ChannelFailure_class = NULL; +static jmethodID LDKNetworkUpdate_ChannelFailure_meth = NULL; static jclass LDKNetworkUpdate_NodeFailure_class = NULL; static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) { @@ -2243,11 +2134,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JN CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL); LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "", "(J)V"); CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL); - LDKNetworkUpdate_ChannelClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelClosed")); - CHECK(LDKNetworkUpdate_ChannelClosed_class != NULL); - LDKNetworkUpdate_ChannelClosed_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelClosed_class, "", "(JZ)V"); - CHECK(LDKNetworkUpdate_ChannelClosed_meth != NULL); + LDKNetworkUpdate_ChannelFailure_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelFailure")); + CHECK(LDKNetworkUpdate_ChannelFailure_class != NULL); + LDKNetworkUpdate_ChannelFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelFailure_class, "", "(JZ)V"); + CHECK(LDKNetworkUpdate_ChannelFailure_meth != NULL); LDKNetworkUpdate_NodeFailure_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure")); CHECK(LDKNetworkUpdate_NodeFailure_class != NULL); @@ -2266,10 +2157,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from msg_ref = (uintptr_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref); } - case LDKNetworkUpdate_ChannelClosed: { - int64_t short_channel_id_conv = obj->channel_closed.short_channel_id; - jboolean is_permanent_conv = obj->channel_closed.is_permanent; - return (*env)->NewObject(env, LDKNetworkUpdate_ChannelClosed_class, LDKNetworkUpdate_ChannelClosed_meth, short_channel_id_conv, is_permanent_conv); + case LDKNetworkUpdate_ChannelFailure: { + int64_t short_channel_id_conv = obj->channel_failure.short_channel_id; + jboolean is_permanent_conv = obj->channel_failure.is_permanent; + return (*env)->NewObject(env, LDKNetworkUpdate_ChannelFailure_class, LDKNetworkUpdate_ChannelFailure_meth, short_channel_id_conv, is_permanent_conv); } case LDKNetworkUpdate_NodeFailure: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -2373,50 +2264,20 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ } return ret; } -static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; -static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; -static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; -static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { - LDKPaymentPurpose_InvoicePayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment")); - CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); - LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[B)V"); - CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); - LDKPaymentPurpose_SpontaneousPayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment")); - CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); - LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); - CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); - switch(obj->tag) { - case LDKPaymentPurpose_InvoicePayment: { - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); - int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); - return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr); - } - case LDKPaymentPurpose_SpontaneousPayment: { - int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); - return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); - } - default: abort(); - } -} static jclass LDKEvent_FundingGenerationReady_class = NULL; static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; static jclass LDKEvent_PaymentReceived_class = NULL; static jmethodID LDKEvent_PaymentReceived_meth = NULL; +static jclass LDKEvent_PaymentClaimed_class = NULL; +static jmethodID LDKEvent_PaymentClaimed_meth = NULL; static jclass LDKEvent_PaymentSent_class = NULL; static jmethodID LDKEvent_PaymentSent_meth = NULL; -static jclass LDKEvent_PaymentPathFailed_class = NULL; -static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; static jclass LDKEvent_PaymentFailed_class = NULL; static jmethodID LDKEvent_PaymentFailed_meth = NULL; +static jclass LDKEvent_PaymentPathSuccessful_class = NULL; +static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL; +static jclass LDKEvent_PaymentPathFailed_class = NULL; +static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; static jclass LDKEvent_SpendableOutputs_class = NULL; @@ -2427,36 +2288,44 @@ static jclass LDKEvent_ChannelClosed_class = NULL; static jmethodID LDKEvent_ChannelClosed_meth = NULL; static jclass LDKEvent_DiscardFunding_class = NULL; static jmethodID LDKEvent_DiscardFunding_meth = NULL; -static jclass LDKEvent_PaymentPathSuccessful_class = NULL; -static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL; static jclass LDKEvent_OpenChannelRequest_class = NULL; static jmethodID LDKEvent_OpenChannelRequest_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { LDKEvent_FundingGenerationReady_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady")); CHECK(LDKEvent_FundingGenerationReady_class != NULL); - LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); + LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([B[BJ[BJ)V"); CHECK(LDKEvent_FundingGenerationReady_meth != NULL); LDKEvent_PaymentReceived_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentReceived")); CHECK(LDKEvent_PaymentReceived_class != NULL); LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([BJJ)V"); CHECK(LDKEvent_PaymentReceived_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, "", "([BJJ)V"); + CHECK(LDKEvent_PaymentClaimed_meth != NULL); LDKEvent_PaymentSent_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent")); CHECK(LDKEvent_PaymentSent_class != NULL); LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B[B[BJ)V"); CHECK(LDKEvent_PaymentSent_meth != NULL); - LDKEvent_PaymentPathFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed")); - CHECK(LDKEvent_PaymentPathFailed_class != NULL); - LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); - CHECK(LDKEvent_PaymentPathFailed_meth != NULL); LDKEvent_PaymentFailed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed")); CHECK(LDKEvent_PaymentFailed_class != NULL); LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "", "([B[B)V"); CHECK(LDKEvent_PaymentFailed_meth != NULL); + LDKEvent_PaymentPathSuccessful_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful")); + CHECK(LDKEvent_PaymentPathSuccessful_class != NULL); + LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "", "([B[B[J)V"); + CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL); + LDKEvent_PaymentPathFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed")); + CHECK(LDKEvent_PaymentPathFailed_class != NULL); + LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); + CHECK(LDKEvent_PaymentPathFailed_meth != NULL); LDKEvent_PendingHTLCsForwardable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable")); CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); @@ -2470,7 +2339,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, "", "(JZ)V"); + LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "([B[BJZ)V"); CHECK(LDKEvent_PaymentForwarded_meth != NULL); LDKEvent_ChannelClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed")); @@ -2482,11 +2351,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en CHECK(LDKEvent_DiscardFunding_class != NULL); LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "([B[B)V"); CHECK(LDKEvent_DiscardFunding_meth != NULL); - LDKEvent_PaymentPathSuccessful_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful")); - CHECK(LDKEvent_PaymentPathSuccessful_class != NULL); - LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "", "([B[B[J)V"); - CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL); LDKEvent_OpenChannelRequest_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OpenChannelRequest")); CHECK(LDKEvent_OpenChannelRequest_class != NULL); @@ -2499,19 +2363,28 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN case LDKEvent_FundingGenerationReady: { int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data); + int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->funding_generation_ready.counterparty_node_id.compressed_form); int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis; LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen); (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data); int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id; - return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_conv); + return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, counterparty_node_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_conv); } case LDKEvent_PaymentReceived: { int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data); - int64_t amt_conv = obj->payment_received.amt; + int64_t amount_msat_conv = obj->payment_received.amount_msat; int64_t purpose_ref = ((uintptr_t)&obj->payment_received.purpose) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, amt_conv, purpose_ref); + return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, amount_msat_conv, purpose_ref); + } + case LDKEvent_PaymentClaimed: { + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimed.payment_hash.data); + int64_t amount_msat_conv = obj->payment_claimed.amount_msat; + int64_t purpose_ref = ((uintptr_t)&obj->payment_claimed.purpose) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, payment_hash_arr, amount_msat_conv, purpose_ref); } case LDKEvent_PaymentSent: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); @@ -2523,6 +2396,34 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN int64_t fee_paid_msat_ref = ((uintptr_t)&obj->payment_sent.fee_paid_msat) | 1; return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref); } + case LDKEvent_PaymentFailed: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data); + return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr); + } + case LDKEvent_PaymentPathSuccessful: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data); + LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path; + int64_tArray path_arr = NULL; + path_arr = (*env)->NewLongArray(env, path_var.datalen); + int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + int64_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner & ~1; + path_arr_ptr[k] = path_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); + return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr); + } case LDKEvent_PaymentPathFailed: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data); @@ -2556,13 +2457,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN } return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, rejected_by_dest_conv, network_update_ref, all_paths_failed_conv, path_arr, short_channel_id_ref, retry_ref); } - case LDKEvent_PaymentFailed: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data); - return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr); - } case LDKEvent_PendingHTLCsForwardable: { int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable; return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, time_forwardable_conv); @@ -2580,9 +2474,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr); } case LDKEvent_PaymentForwarded: { + int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->payment_forwarded.prev_channel_id.data); + int8_tArray next_channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, next_channel_id_arr, 0, 32, obj->payment_forwarded.next_channel_id.data); int64_t fee_earned_msat_ref = ((uintptr_t)&obj->payment_forwarded.fee_earned_msat) | 1; jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx; - return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, claim_from_onchain_tx_conv); + return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, prev_channel_id_arr, next_channel_id_arr, fee_earned_msat_ref, claim_from_onchain_tx_conv); } case LDKEvent_ChannelClosed: { int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); @@ -2599,27 +2497,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr); } - case LDKEvent_PaymentPathSuccessful: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data); - LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path; - int64_tArray path_arr = NULL; - path_arr = (*env)->NewLongArray(env, path_var.datalen); - int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - int64_t path_conv_10_ref = 0; - CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uintptr_t)path_conv_10_var.inner & ~1; - path_arr_ptr[k] = path_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); - return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr); - } case LDKEvent_OpenChannelRequest: { int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->open_channel_request.temporary_channel_id.data); @@ -2795,8 +2672,8 @@ static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL; static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL; static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL; static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL; -static jclass LDKMessageSendEvent_SendFundingLocked_class = NULL; -static jmethodID LDKMessageSendEvent_SendFundingLocked_meth = NULL; +static jclass LDKMessageSendEvent_SendChannelReady_class = NULL; +static jmethodID LDKMessageSendEvent_SendChannelReady_meth = NULL; static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL; static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL; static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL; @@ -2848,11 +2725,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL); LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "", "([BJ)V"); CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL); - LDKMessageSendEvent_SendFundingLocked_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked")); - CHECK(LDKMessageSendEvent_SendFundingLocked_class != NULL); - LDKMessageSendEvent_SendFundingLocked_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingLocked_class, "", "([BJ)V"); - CHECK(LDKMessageSendEvent_SendFundingLocked_meth != NULL); + LDKMessageSendEvent_SendChannelReady_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReady")); + CHECK(LDKMessageSendEvent_SendChannelReady_class != NULL); + LDKMessageSendEvent_SendChannelReady_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReady_class, "", "([BJ)V"); + CHECK(LDKMessageSendEvent_SendChannelReady_meth != NULL); LDKMessageSendEvent_SendAnnouncementSignatures_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures")); CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL); @@ -2976,16 +2853,16 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f msg_ref = (uintptr_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref); } - case LDKMessageSendEvent_SendFundingLocked: { + case LDKMessageSendEvent_SendChannelReady: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_locked.node_id.compressed_form); - LDKFundingLocked msg_var = obj->send_funding_locked.msg; + (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_ready.node_id.compressed_form); + LDKChannelReady msg_var = obj->send_channel_ready.msg; int64_t msg_ref = 0; CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uintptr_t)msg_var.inner & ~1; - return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref); + return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReady_class, LDKMessageSendEvent_SendChannelReady_meth, node_id_arr, msg_ref); } case LDKMessageSendEvent_SendAnnouncementSignatures: { int8_tArray node_id_arr = (*env)->NewByteArray(env, 33); @@ -3157,31 +3034,166 @@ static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCV } return ret; } -static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return FixedPenaltyScorer_clone(&*owner->contents.result); + return TxOut_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(owner & ~1); - LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv); + return (int64_t)ret_ref; +} + +static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return AccessError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); + jclass ret_conv = LDKAccessError_to_java(env, CResult_TxOutAccessErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); + int64_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv); + return ret_conv; +} + +static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); + LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { + LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]); } - return ret_ref; + return ret; +} +static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) { + LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ 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 inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(owner & ~1); + CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv); } -static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ +static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return ChannelMonitorUpdateErr_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(owner & ~1); + jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv)); + return ret_conv; +} + +static jclass LDKMonitorEvent_HTLCEvent_class = NULL; +static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL; +static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL; +static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL; +static jclass LDKMonitorEvent_UpdateCompleted_class = NULL; +static jmethodID LDKMonitorEvent_UpdateCompleted_meth = NULL; +static jclass LDKMonitorEvent_UpdateFailed_class = NULL; +static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) { + LDKMonitorEvent_HTLCEvent_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent")); + CHECK(LDKMonitorEvent_HTLCEvent_class != NULL); + LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "", "(J)V"); + CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL); + LDKMonitorEvent_CommitmentTxConfirmed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed")); + CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL); + LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "", "(J)V"); + CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL); + LDKMonitorEvent_UpdateCompleted_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted")); + CHECK(LDKMonitorEvent_UpdateCompleted_class != NULL); + LDKMonitorEvent_UpdateCompleted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateCompleted_class, "", "(JJ)V"); + CHECK(LDKMonitorEvent_UpdateCompleted_meth != NULL); + LDKMonitorEvent_UpdateFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed")); + CHECK(LDKMonitorEvent_UpdateFailed_class != NULL); + LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "", "(J)V"); + CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); + switch(obj->tag) { + case LDKMonitorEvent_HTLCEvent: { + LDKHTLCUpdate htlc_event_var = obj->htlc_event; + int64_t htlc_event_ref = 0; + CHECK((((uintptr_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); + htlc_event_ref = (uintptr_t)htlc_event_var.inner & ~1; + return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref); + } + case LDKMonitorEvent_CommitmentTxConfirmed: { + LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed; + int64_t commitment_tx_confirmed_ref = 0; + CHECK((((uintptr_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); + commitment_tx_confirmed_ref = (uintptr_t)commitment_tx_confirmed_var.inner & ~1; + return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref); + } + case LDKMonitorEvent_UpdateCompleted: { + LDKOutPoint funding_txo_var = obj->update_completed.funding_txo; + int64_t funding_txo_ref = 0; + CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); + funding_txo_ref = (uintptr_t)funding_txo_var.inner & ~1; + int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id; + return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, monitor_update_id_conv); + } + case LDKMonitorEvent_UpdateFailed: { + LDKOutPoint update_failed_var = obj->update_failed; + int64_t update_failed_ref = 0; + CHECK((((uintptr_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); + update_failed_ref = (uintptr_t)update_failed_var.inner & ~1; + return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref); + } + default: abort(); + } +} +static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { + LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MonitorEvent_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorEventZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR owner){ + return OutPoint_clone(&owner->a); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(owner & ~1); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorEventZZ_get_a(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3193,13 +3205,71 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorer return ret_ref; } -static inline struct LDKScoringParameters CResult_ScoringParametersDecodeErrorZ_get_ok(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKCVec_MonitorEventZ C2Tuple_OutPointCVec_MonitorEventZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR owner){ + return CVec_MonitorEventZ_clone(&owner->b); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(owner & ~1); + LDKCVec_MonitorEventZ ret_var = C2Tuple_OutPointCVec_MonitorEventZZ_get_b(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t o = 0; o < ret_var.datalen; o++) { + LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_conv_14_copy = ret_var.data[o]; + int64_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; + ret_arr_ptr[o] = ret_conv_14_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointCVec_MonitorEventZZ_clone(&orig->data[i]); + } + return ret; +} +static jclass LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = NULL; +static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = NULL; +static jclass LDKCOption_C2Tuple_usizeTransactionZZ_None_class = NULL; +static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1usizeTransactionZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_usizeTransactionZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some")); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_class != NULL); + LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth != NULL); + LDKCOption_C2Tuple_usizeTransactionZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None")); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_class != NULL); + LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, "", "()V"); + CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeTransactionZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_C2Tuple_usizeTransactionZZ_Some: { + LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *some_conv = obj->some; + *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv); + return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth, ((int64_t)some_conv)); + } + case LDKCOption_C2Tuple_usizeTransactionZZ_None: { + return (*env)->NewObject(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, LDKCOption_C2Tuple_usizeTransactionZZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ScoringParameters_clone(&*owner->contents.result); + return FixedPenaltyScorer_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ScoringParametersDecodeErrorZ* owner_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(owner & ~1); - LDKScoringParameters ret_var = CResult_ScoringParametersDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(owner & ~1); + LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3211,13 +3281,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD return ret_ref; } -static inline struct LDKDecodeError CResult_ScoringParametersDecodeErrorZ_get_err(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ScoringParametersDecodeErrorZ* owner_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_ScoringParametersDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3229,39 +3299,85 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD return ret_ref; } -static inline struct LDKScorer *CResult_ScorerDecodeErrorZ_get_ok(LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return &*owner->contents.result; +typedef struct LDKLogger_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID log_meth; +} LDKLogger_JCalls; +static void LDKLogger_JCalls_free(void* this_arg) { + LDKLogger_JCalls *j_calls = (LDKLogger_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); + } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ScorerDecodeErrorZ* owner_conv = (LDKCResult_ScorerDecodeErrorZ*)(owner & ~1); - LDKScorer ret_var = *CResult_ScorerDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner & ~1; - return ret_ref; +void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { + LDKLogger_JCalls *j_calls = (LDKLogger_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); + } + LDKRecord record_var = *record; + int64_t record_ref = 0; + record_var = Record_clone(&record_var); + CHECK((((uintptr_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); + record_ref = (uintptr_t)record_var.inner; + if (record_var.is_owned) { + record_ref |= 1; + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } +static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V"); + CHECK(calls->log_meth != NULL); -static inline struct LDKDecodeError CResult_ScorerDecodeErrorZ_get_err(LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + LDKLogger ret = { + .this_arg = (void*) calls, + .log = log_LDKLogger_jcall, + .free = LDKLogger_JCalls_free, + }; + return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ScorerDecodeErrorZ* owner_conv = (LDKCResult_ScorerDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_ScorerDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new(JNIEnv *env, jclass clz, jobject o) { + LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger"); + *res_ptr = LDKLogger_init(env, clz, o); + return (uint64_t)res_ptr; } - static inline struct LDKProbabilisticScorer *CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return &*owner->contents.result; @@ -3475,49 +3591,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeature return ret_ref; } -static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return DelayedPaymentOutputDescriptor_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return StaticPaymentOutputDescriptor_clone(&*owner->contents.result); + return NodeId_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); + LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3529,13 +3609,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu return ret_ref; } -static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3547,25 +3627,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu return ret_ref; } -static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return SpendableOutputDescriptor_clone(&*owner->contents.result); + return COption_NetworkUpdateZ_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); + LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); + *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -3577,293 +3657,963 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDes return ret_ref; } -static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) { - LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]); +typedef struct LDKAccess_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID get_utxo_meth; +} LDKAccess_JCalls; +static void LDKAccess_JCalls_free(void* this_arg) { + LDKAccess_JCalls *j_calls = (LDKAccess_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); } - return ret; } -static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){ - return owner->a; +LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) { + LDKAccess_JCalls *j_calls = (LDKAccess_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 genesis_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash); + int64_t short_channel_id_conv = short_channel_id; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception."); + } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); + FREE((void*)ret); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form); - return ret_arr; +static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) { + LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } +static inline LDKAccess LDKAccess_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J"); + CHECK(calls->get_utxo_meth != NULL); -static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){ - return owner->b; -} -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); - LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - return ret_arr; + LDKAccess ret = { + .this_arg = (void*) calls, + .get_utxo = get_utxo_LDKAccess_jcall, + .free = LDKAccess_JCalls_free, + }; + return ret; } - -static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new(JNIEnv *env, jclass clz, jobject o) { + LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *res_ptr = LDKAccess_init(env, clz, o); + return (uint64_t)res_ptr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); - LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr; + unsigned char genesis_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, genesis_hash) == 32); + (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr); + unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr; + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id); + return (int64_t)ret_conv; } -static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +static jclass LDKCOption_AccessZ_Some_class = NULL; +static jmethodID LDKCOption_AccessZ_Some_meth = NULL; +static jclass LDKCOption_AccessZ_None_class = NULL; +static jmethodID LDKCOption_AccessZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AccessZ_init (JNIEnv *env, jclass clz) { + LDKCOption_AccessZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$Some")); + CHECK(LDKCOption_AccessZ_Some_class != NULL); + LDKCOption_AccessZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_AccessZ_Some_meth != NULL); + LDKCOption_AccessZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$None")); + CHECK(LDKCOption_AccessZ_None_class != NULL); + LDKCOption_AccessZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_None_class, "", "()V"); + CHECK(LDKCOption_AccessZ_None_meth != NULL); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_AccessZ_Some: { + LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *some_ret = obj->some; + // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances + if ((*some_ret).free == LDKAccess_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAccess_JCalls_cloned(&(*some_ret)); + } + return (*env)->NewObject(env, LDKCOption_AccessZ_Some_class, LDKCOption_AccessZ_Some_meth, (int64_t)some_ret); + } + case LDKCOption_AccessZ_None: { + return (*env)->NewObject(env, LDKCOption_AccessZ_None_class, LDKCOption_AccessZ_None_meth); + } + default: abort(); + } } - -static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){ +static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); + jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv); + return ret_conv; } -static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){ +static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return *owner->contents.err; + return LightningError_clone(&*owner->contents.err); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); - CResult_SignatureNoneZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); + LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){ - return owner->a; +static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ + return ChannelAnnouncement_clone(&owner->a); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); + LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){ - return owner->b; +static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ + return ChannelUpdate_clone(&owner->b); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); + LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result); +static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ + return ChannelUpdate_clone(&owner->c); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(owner & ~1); - LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); + LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) { + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(&orig->data[i]); + } + return ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(owner & ~1); - CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv); +static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) { + LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = NodeAnnouncement_clone(&orig->data[i]); + } + return ret; } - -static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){ +static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)(owner & ~1); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); + CResult_NoneLightningErrorZ_get_ok(owner_conv); } -static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){ +static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return *owner->contents.err; + return LightningError_clone(&*owner->contents.err); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)(owner & ~1); - CResult_SecretKeyNoneZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); + LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -typedef struct LDKBaseSign_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID get_per_commitment_point_meth; - jmethodID release_commitment_secret_meth; - jmethodID validate_holder_commitment_meth; - jmethodID channel_keys_id_meth; - jmethodID sign_counterparty_commitment_meth; - jmethodID validate_counterparty_revocation_meth; - jmethodID sign_holder_commitment_and_htlcs_meth; - jmethodID sign_justice_revoked_output_meth; - jmethodID sign_justice_revoked_htlc_meth; - jmethodID sign_counterparty_htlc_transaction_meth; - jmethodID sign_closing_transaction_meth; - jmethodID sign_channel_announcement_meth; - jmethodID ready_channel_meth; -} LDKBaseSign_JCalls; -static void LDKBaseSign_JCalls_free(void* this_arg) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); - } +static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ChannelUpdateInfo_clone(&*owner->contents.result); } -LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); - } - int64_t idx_conv = idx; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_per_commitment_point in LDKBaseSign from rust threw an exception."); - } - LDKPublicKey ret_ref; - CHECK((*env)->GetArrayLength(env, ret) == 33); - (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(owner & ~1); + LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); - } - int64_t idx_conv = idx; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to release_commitment_secret in LDKBaseSign 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); + +static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + +static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ChannelInfo_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); + LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - LDKHolderCommitmentTransaction holder_tx_var = *holder_tx; - int64_t holder_tx_ref = 0; - holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var); - CHECK((((uintptr_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); - holder_tx_ref = (uintptr_t)holder_tx_var.inner; - if (holder_tx_var.is_owned) { - holder_tx_ref |= 1; + return ret_ref; +} + +static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - LDKCVec_PaymentPreimageZ preimages_var = preimages; - jobjectArray preimages_arr = NULL; - preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < preimages_var.datalen; i++) { - int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data); - (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr); + return ret_ref; +} + +static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return RoutingFees_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); + LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - - FREE(preimages_var.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref, preimages_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception."); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); - FREE((void*)ret); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + return ret_ref; +} + +static jclass LDKNetAddress_IPv4_class = NULL; +static jmethodID LDKNetAddress_IPv4_meth = NULL; +static jclass LDKNetAddress_IPv6_class = NULL; +static jmethodID LDKNetAddress_IPv6_meth = NULL; +static jclass LDKNetAddress_OnionV2_class = NULL; +static jmethodID LDKNetAddress_OnionV2_meth = NULL; +static jclass LDKNetAddress_OnionV3_class = NULL; +static jmethodID LDKNetAddress_OnionV3_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) { + LDKNetAddress_IPv4_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4")); + CHECK(LDKNetAddress_IPv4_class != NULL); + LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "", "([BS)V"); + CHECK(LDKNetAddress_IPv4_meth != NULL); + LDKNetAddress_IPv6_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6")); + CHECK(LDKNetAddress_IPv6_class != NULL); + LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "", "([BS)V"); + CHECK(LDKNetAddress_IPv6_meth != NULL); + LDKNetAddress_OnionV2_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2")); + CHECK(LDKNetAddress_OnionV2_class != NULL); + LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "", "([B)V"); + CHECK(LDKNetAddress_OnionV2_meth != NULL); + LDKNetAddress_OnionV3_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3")); + CHECK(LDKNetAddress_OnionV3_class != NULL); + LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "", "([BSBS)V"); + CHECK(LDKNetAddress_OnionV3_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); + switch(obj->tag) { + case LDKNetAddress_IPv4: { + int8_tArray addr_arr = (*env)->NewByteArray(env, 4); + (*env)->SetByteArrayRegion(env, addr_arr, 0, 4, obj->i_pv4.addr.data); + int16_t port_conv = obj->i_pv4.port; + return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, port_conv); + } + case LDKNetAddress_IPv6: { + int8_tArray addr_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, addr_arr, 0, 16, obj->i_pv6.addr.data); + int16_t port_conv = obj->i_pv6.port; + return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, port_conv); + } + case LDKNetAddress_OnionV2: { + int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12); + (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data); + return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr); + } + case LDKNetAddress_OnionV3: { + int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data); + int16_t checksum_conv = obj->onion_v3.checksum; + int8_t version_conv = obj->onion_v3.version; + int16_t port_conv = obj->onion_v3.port; + return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, checksum_conv, version_conv, port_conv); + } + default: abort(); } - return ret_conv; } -LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { - LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); +static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) { + LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = NetAddress_clone(&orig->data[i]); } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to channel_keys_id in LDKBaseSign from rust threw an exception."); + return ret; +} +static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return NodeAnnouncementInfo_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); + LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - 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; +} + +static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) { + LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen }; + memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen); + return ret; +} +static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return NodeInfo_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); + LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKNetworkGraph *CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return &*owner->contents.result; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); + LDKNetworkGraph ret_var = *CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner & ~1; + return ret_ref; +} + +static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL; +static jmethodID LDKCOption_CVec_NetAddressZZ_Some_meth = NULL; +static jclass LDKCOption_CVec_NetAddressZZ_None_class = NULL; +static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) { + LDKCOption_CVec_NetAddressZZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some")); + CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL); + LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "", "([J)V"); + CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL); + LDKCOption_CVec_NetAddressZZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None")); + CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL); + LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "", "()V"); + CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_CVec_NetAddressZZ_Some: { + LDKCVec_NetAddressZ some_var = obj->some; + int64_tArray some_arr = NULL; + some_arr = (*env)->NewLongArray(env, some_var.datalen); + int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL); + for (size_t m = 0; m < some_var.datalen; m++) { + int64_t some_conv_12_ref = ((uintptr_t)&some_var.data[m]) | 1; + some_arr_ptr[m] = some_conv_12_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, some_arr, some_arr_ptr, 0); + return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_Some_class, LDKCOption_CVec_NetAddressZZ_Some_meth, some_arr); + } + case LDKCOption_CVec_NetAddressZZ_None: { + return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_None_class, LDKCOption_CVec_NetAddressZZ_None_meth); + } + default: abort(); + } +} +static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return DelayedPaymentOutputDescriptor_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return StaticPaymentOutputDescriptor_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return SpendableOutputDescriptor_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) { + LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ 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 inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form); + return ret_arr; +} + +static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); + LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + return ret_arr; +} + +static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv); + return ((int64_t)ret_conv); +} + +static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv); +} + +static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form); + return ret_arr; +} + +static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); + CResult_SignatureNoneZ_get_err(owner_conv); +} + +static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){ + return owner->a; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form); + return ret_arr; +} + +static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){ + return owner->b; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form); + return ret_arr; +} + +static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(owner & ~1); + LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv); + return ((int64_t)ret_conv); +} + +static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(owner & ~1); + CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv); +} + +static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)(owner & ~1); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes); + return ret_arr; +} + +static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)(owner & ~1); + CResult_SecretKeyNoneZ_get_err(owner_conv); +} + +typedef struct LDKBaseSign_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID get_per_commitment_point_meth; + jmethodID release_commitment_secret_meth; + jmethodID validate_holder_commitment_meth; + jmethodID channel_keys_id_meth; + jmethodID sign_counterparty_commitment_meth; + jmethodID validate_counterparty_revocation_meth; + jmethodID sign_holder_commitment_and_htlcs_meth; + jmethodID sign_justice_revoked_output_meth; + jmethodID sign_justice_revoked_htlc_meth; + jmethodID sign_counterparty_htlc_transaction_meth; + jmethodID sign_closing_transaction_meth; + jmethodID sign_channel_announcement_meth; + jmethodID ready_channel_meth; +} LDKBaseSign_JCalls; +static void LDKBaseSign_JCalls_free(void* this_arg) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + } +} +LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + } + int64_t idx_conv = idx; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to get_per_commitment_point in LDKBaseSign from rust threw an exception."); + } + LDKPublicKey ret_ref; + CHECK((*env)->GetArrayLength(env, ret) == 33); + (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_ref; +} +LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + } + int64_t idx_conv = idx; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to release_commitment_secret in LDKBaseSign 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 validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_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); + } + LDKHolderCommitmentTransaction holder_tx_var = *holder_tx; + int64_t holder_tx_ref = 0; + holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var); + CHECK((((uintptr_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); + holder_tx_ref = (uintptr_t)holder_tx_var.inner; + if (holder_tx_var.is_owned) { + holder_tx_ref |= 1; + } + LDKCVec_PaymentPreimageZ preimages_var = preimages; + jobjectArray preimages_arr = NULL; + preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < preimages_var.datalen; i++) { + int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data); + (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr); + } + + FREE(preimages_var.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref, preimages_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception."); + } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); + FREE((void*)ret); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { + LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to channel_keys_id in LDKBaseSign 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; } @@ -5147,74 +5897,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHa return ret_ref; } -static jclass LDKNetAddress_IPv4_class = NULL; -static jmethodID LDKNetAddress_IPv4_meth = NULL; -static jclass LDKNetAddress_IPv6_class = NULL; -static jmethodID LDKNetAddress_IPv6_meth = NULL; -static jclass LDKNetAddress_OnionV2_class = NULL; -static jmethodID LDKNetAddress_OnionV2_meth = NULL; -static jclass LDKNetAddress_OnionV3_class = NULL; -static jmethodID LDKNetAddress_OnionV3_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) { - LDKNetAddress_IPv4_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4")); - CHECK(LDKNetAddress_IPv4_class != NULL); - LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "", "([BS)V"); - CHECK(LDKNetAddress_IPv4_meth != NULL); - LDKNetAddress_IPv6_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6")); - CHECK(LDKNetAddress_IPv6_class != NULL); - LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "", "([BS)V"); - CHECK(LDKNetAddress_IPv6_meth != NULL); - LDKNetAddress_OnionV2_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2")); - CHECK(LDKNetAddress_OnionV2_class != NULL); - LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "", "([B)V"); - CHECK(LDKNetAddress_OnionV2_meth != NULL); - LDKNetAddress_OnionV3_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3")); - CHECK(LDKNetAddress_OnionV3_class != NULL); - LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "", "([BSBS)V"); - CHECK(LDKNetAddress_OnionV3_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); - switch(obj->tag) { - case LDKNetAddress_IPv4: { - int8_tArray addr_arr = (*env)->NewByteArray(env, 4); - (*env)->SetByteArrayRegion(env, addr_arr, 0, 4, obj->i_pv4.addr.data); - int16_t port_conv = obj->i_pv4.port; - return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, port_conv); - } - case LDKNetAddress_IPv6: { - int8_tArray addr_arr = (*env)->NewByteArray(env, 16); - (*env)->SetByteArrayRegion(env, addr_arr, 0, 16, obj->i_pv6.addr.data); - int16_t port_conv = obj->i_pv6.port; - return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, port_conv); - } - case LDKNetAddress_OnionV2: { - int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12); - (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data); - return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr); - } - case LDKNetAddress_OnionV3: { - int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data); - int16_t checksum_conv = obj->onion_v3.checksum; - int8_t version_conv = obj->onion_v3.version; - int16_t port_conv = obj->onion_v3.port; - return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, checksum_conv, version_conv, port_conv); - } - default: abort(); - } -} -static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) { - LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = NetAddress_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -5606,7 +6288,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void } return ret_conv; } -LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { +LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -5622,20 +6304,20 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to release_pending_monitor_events in LDKWatch from rust threw an exception."); } - LDKCVec_MonitorEventZ ret_constr; + LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ Elements"); else ret_constr.data = NULL; int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t o = 0; o < ret_constr.datalen; o++) { - int64_t ret_conv_14 = ret_vals[o]; - void* ret_conv_14_ptr = (void*)(((uintptr_t)ret_conv_14) & ~1); - CHECK_ACCESS(ret_conv_14_ptr); - LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr); - FREE((void*)ret_conv_14); - ret_constr.data[o] = ret_conv_14_conv; + for (size_t m = 0; m < ret_constr.datalen; m++) { + int64_t ret_conv_38 = ret_vals[m]; + void* ret_conv_38_ptr = (void*)(((uintptr_t)ret_conv_38) & ~1); + CHECK_ACCESS(ret_conv_38_ptr); + LDKC2Tuple_OutPointCVec_MonitorEventZZ ret_conv_38_conv = *(LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(ret_conv_38_ptr); + FREE((void*)ret_conv_38); + ret_constr.data[m] = ret_conv_38_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); if (get_jenv_res == JNI_EDETACHED) { @@ -5717,15 +6399,14 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pendin void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; - LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); + LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t o = 0; o < ret_var.datalen; o++) { - LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_conv_14_copy = ret_var.data[o]; - int64_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; - ret_arr_ptr[o] = ret_conv_14_ref; + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv_38_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ"); + *ret_conv_38_conv = ret_var.data[m]; + ret_arr_ptr[m] = ((int64_t)ret_conv_38_conv); } (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); @@ -6296,85 +6977,6 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat return ret_conv; } -typedef struct LDKLogger_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID log_meth; -} LDKLogger_JCalls; -static void LDKLogger_JCalls_free(void* this_arg) { - LDKLogger_JCalls *j_calls = (LDKLogger_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); - } -} -void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { - LDKLogger_JCalls *j_calls = (LDKLogger_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); - } - LDKRecord record_var = *record; - int64_t record_ref = 0; - record_var = Record_clone(&record_var); - CHECK((((uintptr_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); - record_ref = (uintptr_t)record_var.inner; - if (record_var.is_owned) { - record_ref |= 1; - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) { - LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V"); - CHECK(calls->log_meth != NULL); - - LDKLogger ret = { - .this_arg = (void*) calls, - .log = log_LDKLogger_jcall, - .free = LDKLogger_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new(JNIEnv *env, jclass clz, jobject o) { - LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger"); - *res_ptr = LDKLogger_init(env, clz, o); - return (uint64_t)res_ptr; -} static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -7705,33 +8307,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash return ret_ref; } -static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); - CResult_NoneLightningErrorZ_get_ok(owner_conv); -} - -static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return LightningError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); - LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){ return owner->a; } @@ -7759,99 +8334,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); - jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv); - return ret_conv; -} - -static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return LightningError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); - LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ - return ChannelAnnouncement_clone(&owner->a); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); - LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ - return ChannelUpdate_clone(&owner->b); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); - LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){ - return ChannelUpdate_clone(&owner->c); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); - LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(&orig->data[i]); - } - return ret; -} -static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) { - LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = NodeAnnouncement_clone(&orig->data[i]); - } - return ret; -} static jclass LDKCOption_NetAddressZ_Some_class = NULL; static jmethodID LDKCOption_NetAddressZ_Some_meth = NULL; static jclass LDKCOption_NetAddressZ_None_class = NULL; @@ -7967,455 +8449,68 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErro return ret_ref; } -static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return NodeId_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); - LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); +static jclass LDKGraphSyncError_DecodeError_class = NULL; +static jmethodID LDKGraphSyncError_DecodeError_meth = NULL; +static jclass LDKGraphSyncError_LightningError_class = NULL; +static jmethodID LDKGraphSyncError_LightningError_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGraphSyncError_init (JNIEnv *env, jclass clz) { + LDKGraphSyncError_DecodeError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$DecodeError")); + CHECK(LDKGraphSyncError_DecodeError_class != NULL); + LDKGraphSyncError_DecodeError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_DecodeError_class, "", "(J)V"); + CHECK(LDKGraphSyncError_DecodeError_meth != NULL); + LDKGraphSyncError_LightningError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$LightningError")); + CHECK(LDKGraphSyncError_LightningError_class != NULL); + LDKGraphSyncError_LightningError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_LightningError_class, "", "(J)V"); + CHECK(LDKGraphSyncError_LightningError_meth != NULL); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return COption_NetworkUpdateZ_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); - LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); - *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -typedef struct LDKAccess_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID get_utxo_meth; -} LDKAccess_JCalls; -static void LDKAccess_JCalls_free(void* this_arg) { - LDKAccess_JCalls *j_calls = (LDKAccess_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_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) { - LDKAccess_JCalls *j_calls = (LDKAccess_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 genesis_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash); - int64_t short_channel_id_conv = short_channel_id; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception."); - } - void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); - CHECK_ACCESS(ret_ptr); - LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); - FREE((void*)ret); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) { - LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKAccess LDKAccess_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J"); - CHECK(calls->get_utxo_meth != NULL); - - LDKAccess ret = { - .this_arg = (void*) calls, - .get_utxo = get_utxo_LDKAccess_jcall, - .free = LDKAccess_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new(JNIEnv *env, jclass clz, jobject o) { - LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); - *res_ptr = LDKAccess_init(env, clz, o); - return (uint64_t)res_ptr; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr; - unsigned char genesis_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, genesis_hash) == 32); - (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr); - unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr; - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id); - return (int64_t)ret_conv; -} - -static jclass LDKCOption_AccessZ_Some_class = NULL; -static jmethodID LDKCOption_AccessZ_Some_meth = NULL; -static jclass LDKCOption_AccessZ_None_class = NULL; -static jmethodID LDKCOption_AccessZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AccessZ_init (JNIEnv *env, jclass clz) { - LDKCOption_AccessZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$Some")); - CHECK(LDKCOption_AccessZ_Some_class != NULL); - LDKCOption_AccessZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_AccessZ_Some_meth != NULL); - LDKCOption_AccessZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$None")); - CHECK(LDKCOption_AccessZ_None_class != NULL); - LDKCOption_AccessZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_None_class, "", "()V"); - CHECK(LDKCOption_AccessZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)(ptr & ~1); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKGraphSyncError *obj = (LDKGraphSyncError*)(ptr & ~1); switch(obj->tag) { - case LDKCOption_AccessZ_Some: { - LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess"); - *some_ret = obj->some; - // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances - if ((*some_ret).free == LDKAccess_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKAccess_JCalls_cloned(&(*some_ret)); - } - return (*env)->NewObject(env, LDKCOption_AccessZ_Some_class, LDKCOption_AccessZ_Some_meth, (int64_t)some_ret); + case LDKGraphSyncError_DecodeError: { + LDKDecodeError decode_error_var = obj->decode_error; + int64_t decode_error_ref = 0; + CHECK((((uintptr_t)decode_error_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&decode_error_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(decode_error_var); + decode_error_ref = (uintptr_t)decode_error_var.inner & ~1; + return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref); } - case LDKCOption_AccessZ_None: { - return (*env)->NewObject(env, LDKCOption_AccessZ_None_class, LDKCOption_AccessZ_None_meth); + case LDKGraphSyncError_LightningError: { + LDKLightningError lightning_error_var = obj->lightning_error; + int64_t lightning_error_ref = 0; + CHECK((((uintptr_t)lightning_error_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&lightning_error_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var); + lightning_error_ref = (uintptr_t)lightning_error_var.inner & ~1; + return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref); } default: abort(); } } -static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){ +static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ChannelUpdateInfo_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(owner & ~1); - LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return ChannelInfo_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); - LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return RoutingFees_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); - LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return NodeAnnouncementInfo_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); - LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) { - LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen }; - memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen); - return ret; -} -static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return NodeInfo_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); - LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return NetworkGraph_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); - LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)(owner & ~1); + int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv); + return ret_conv; } -static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return GraphSyncError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)(owner & ~1); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL; -static jmethodID LDKCOption_CVec_NetAddressZZ_Some_meth = NULL; -static jclass LDKCOption_CVec_NetAddressZZ_None_class = NULL; -static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) { - LDKCOption_CVec_NetAddressZZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some")); - CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL); - LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "", "([J)V"); - CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL); - LDKCOption_CVec_NetAddressZZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None")); - CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL); - LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "", "()V"); - CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)(ptr & ~1); - switch(obj->tag) { - case LDKCOption_CVec_NetAddressZZ_Some: { - LDKCVec_NetAddressZ some_var = obj->some; - int64_tArray some_arr = NULL; - some_arr = (*env)->NewLongArray(env, some_var.datalen); - int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL); - for (size_t m = 0; m < some_var.datalen; m++) { - int64_t some_conv_12_ref = ((uintptr_t)&some_var.data[m]) | 1; - some_arr_ptr[m] = some_conv_12_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, some_arr, some_arr_ptr, 0); - return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_Some_class, LDKCOption_CVec_NetAddressZZ_Some_meth, some_arr); - } - case LDKCOption_CVec_NetAddressZZ_None: { - return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_None_class, LDKCOption_CVec_NetAddressZZ_None_meth); - } - default: abort(); - } -} static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return NetAddress_clone(&*owner->contents.result); @@ -8762,13 +8857,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod return ret_ref; } -static inline struct LDKFundingLocked CResult_FundingLockedDecodeErrorZ_get_ok(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return FundingLocked_clone(&*owner->contents.result); + return ChannelReady_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_FundingLockedDecodeErrorZ* owner_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(owner & ~1); - LDKFundingLocked ret_var = CResult_FundingLockedDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(owner & ~1); + LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -8780,13 +8875,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod return ret_ref; } -static inline struct LDKDecodeError CResult_FundingLockedDecodeErrorZ_get_err(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_FundingLockedDecodeErrorZ* owner_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(owner & ~1); - LDKDecodeError ret_var = CResult_FundingLockedDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(owner & ~1); + LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -10205,15 +10300,17 @@ 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 LDKListen_JCalls { +typedef struct LDKScore_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID block_connected_meth; - jmethodID block_disconnected_meth; -} LDKListen_JCalls; -static void LDKListen_JCalls_free(void* this_arg) { - LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; + jmethodID channel_penalty_msat_meth; + jmethodID payment_path_failed_meth; + jmethodID payment_path_successful_meth; + jmethodID write_meth; +} LDKScore_JCalls; +static void LDKScore_JCalls_free(void* this_arg) { + LDKScore_JCalls *j_calls = (LDKScore_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); @@ -10229,8 +10326,8 @@ static void LDKListen_JCalls_free(void* this_arg) { FREE(j_calls); } } -void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { - LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; +uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) { + LDKScore_JCalls *j_calls = (LDKScore_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) { @@ -10238,23 +10335,50 @@ void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uin } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKu8slice block_var = block; - int8_tArray block_arr = (*env)->NewByteArray(env, block_var.datalen); - (*env)->SetByteArrayRegion(env, block_arr, 0, block_var.datalen, block_var.data); - int32_t height_conv = height; + int64_t short_channel_id_conv = short_channel_id; + LDKNodeId source_var = *source; + int64_t source_ref = 0; + source_var = NodeId_clone(&source_var); + CHECK((((uintptr_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); + source_ref = (uintptr_t)source_var.inner; + if (source_var.is_owned) { + source_ref |= 1; + } + LDKNodeId target_var = *target; + int64_t target_ref = 0; + target_var = NodeId_clone(&target_var); + CHECK((((uintptr_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); + target_ref = (uintptr_t)target_var.inner; + if (target_var.is_owned) { + target_ref |= 1; + } + LDKChannelUsage usage_var = usage; + int64_t usage_ref = 0; + CHECK((((uintptr_t)usage_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&usage_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var); + usage_ref = (uintptr_t)usage_var.inner; + if (usage_var.is_owned) { + usage_ref |= 1; + } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height_conv); + int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id_conv, source_ref, target_ref, usage_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception."); + (*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } + return ret; } -void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { - LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; +void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { + LDKScore_JCalls *j_calls = (LDKScore_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) { @@ -10262,82 +10386,224 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h } else { DO_ASSERT(get_jenv_res == JNI_OK); } - int8_tArray header_arr = (*env)->NewByteArray(env, 80); - (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); - int32_t height_conv = height; + LDKCVec_RouteHopZ path_var = path; + int64_tArray path_arr = NULL; + path_arr = (*env)->NewLongArray(env, path_var.datalen); + int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + int64_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; + if (path_conv_10_var.is_owned) { + path_conv_10_ref |= 1; + } + path_arr_ptr[k] = path_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); + FREE(path_var.data); + int64_t short_channel_id_conv = short_channel_id; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height_conv); + (*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_arr, short_channel_id_conv); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception."); + (*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } } -static void LDKListen_JCalls_cloned(LDKListen* new_obj) { - LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; +void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) { + LDKScore_JCalls *j_calls = (LDKScore_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); + } + LDKCVec_RouteHopZ path_var = path; + int64_tArray path_arr = NULL; + path_arr = (*env)->NewLongArray(env, path_var.datalen); + int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + int64_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; + if (path_conv_10_var.is_owned) { + path_conv_10_ref |= 1; + } + path_arr_ptr[k] = path_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); + FREE(path_var.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception."); + } + LDKCVec_u8Z ret_ref; + ret_ref.datalen = (*env)->GetArrayLength(env, ret); + ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_ref; +} +static void LDKScore_JCalls_cloned(LDKScore* new_obj) { + LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } -static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) { +static inline LDKScore LDKScore_init (JNIEnv *env, jclass clz, jobject o) { jclass c = (*env)->GetObjectClass(env, o); CHECK(c != NULL); - LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls"); + LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls"); atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BI)V"); - CHECK(calls->block_connected_meth != NULL); - calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V"); - CHECK(calls->block_disconnected_meth != NULL); + calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJ)J"); + CHECK(calls->channel_penalty_msat_meth != NULL); + calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "([JJ)V"); + CHECK(calls->payment_path_failed_meth != NULL); + calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "([J)V"); + CHECK(calls->payment_path_successful_meth != NULL); + calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B"); + CHECK(calls->write_meth != NULL); - LDKListen ret = { + LDKScore ret = { .this_arg = (void*) calls, - .block_connected = block_connected_LDKListen_jcall, - .block_disconnected = block_disconnected_LDKListen_jcall, - .free = LDKListen_JCalls_free, + .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall, + .payment_path_failed = payment_path_failed_LDKScore_jcall, + .payment_path_successful = payment_path_successful_LDKScore_jcall, + .write = write_LDKScore_jcall, + .free = LDKScore_JCalls_free, }; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, jclass clz, jobject o) { - LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen"); - *res_ptr = LDKListen_init(env, clz, o); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKScore_1new(JNIEnv *env, jclass clz, jobject o) { + LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore"); + *res_ptr = LDKScore_init(env, clz, o); return (uint64_t)res_ptr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray block, int32_t height) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t source, int64_t target, int64_t usage) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; - LDKu8slice block_ref; - block_ref.datalen = (*env)->GetArrayLength(env, block); - block_ref.data = (*env)->GetByteArrayElements (env, block, NULL); - (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height); - (*env)->ReleaseByteArrayElements(env, block, (int8_t*)block_ref.data, 0); + LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; + LDKNodeId source_conv; + source_conv.inner = (void*)(source & (~1)); + source_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + LDKNodeId target_conv; + target_conv.inner = (void*)(target & (~1)); + target_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + LDKChannelUsage usage_conv; + usage_conv.inner = (void*)(usage & (~1)); + usage_conv.is_owned = (usage & 1) || (usage == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv); + usage_conv = ChannelUsage_clone(&usage_conv); + int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height); + LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; + LDKCVec_RouteHopZ path_constr; + path_constr.datalen = (*env)->GetArrayLength(env, path); + if (path_constr.datalen > 0) + path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + path_constr.data = NULL; + int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); + for (size_t k = 0; k < path_constr.datalen; k++) { + int64_t path_conv_10 = path_vals[k]; + LDKRouteHop path_conv_10_conv; + path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); + path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); + path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); + path_constr.data[k] = path_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); + (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id); } -typedef struct LDKConfirm_JCalls { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; + LDKCVec_RouteHopZ path_constr; + path_constr.datalen = (*env)->GetArrayLength(env, path); + if (path_constr.datalen > 0) + path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + path_constr.data = NULL; + int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); + for (size_t k = 0; k < path_constr.datalen; k++) { + int64_t path_conv_10 = path_vals[k]; + LDKRouteHop path_conv_10_conv; + path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); + path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); + path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); + path_constr.data[k] = path_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); + (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; + LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +typedef struct LDKPersister_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID transactions_confirmed_meth; - jmethodID transaction_unconfirmed_meth; - jmethodID best_block_updated_meth; - jmethodID get_relevant_txids_meth; -} LDKConfirm_JCalls; -static void LDKConfirm_JCalls_free(void* this_arg) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; + jmethodID persist_manager_meth; + jmethodID persist_graph_meth; + jmethodID persist_scorer_meth; +} LDKPersister_JCalls; +static void LDKPersister_JCalls_free(void* this_arg) { + LDKPersister_JCalls *j_calls = (LDKPersister_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); @@ -10353,8 +10619,8 @@ static void LDKConfirm_JCalls_free(void* this_arg) { FREE(j_calls); } } -void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; +LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) { + LDKPersister_JCalls *j_calls = (LDKPersister_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) { @@ -10362,33 +10628,34 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t } else { DO_ASSERT(get_jenv_res == JNI_OK); } - int8_tArray header_arr = (*env)->NewByteArray(env, 80); - (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); - LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata; - int64_tArray txdata_arr = NULL; - txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen); - int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL); - for (size_t c = 0; c < txdata_var.datalen; c++) { - LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *txdata_conv_28_conv = txdata_var.data[c]; - txdata_arr_ptr[c] = ((int64_t)txdata_conv_28_conv); + LDKChannelManager channel_manager_var = *channel_manager; + int64_t channel_manager_ref = 0; + // WARNING: we may need a move here but no clone is available for LDKChannelManager + CHECK((((uintptr_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); + channel_manager_ref = (uintptr_t)channel_manager_var.inner; + if (channel_manager_var.is_owned) { + channel_manager_ref |= 1; } - (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0); - FREE(txdata_var.data); - int32_t height_conv = height; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception."); + (*env)->FatalError(env, "A call to persist_manager in LDKPersister from rust threw an exception."); } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } + return ret_conv; } -void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; +LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) { + LDKPersister_JCalls *j_calls = (LDKPersister_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) { @@ -10396,44 +10663,34 @@ void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_ } else { DO_ASSERT(get_jenv_res == JNI_OK); } - int8_tArray txid_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_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); + LDKNetworkGraph network_graph_var = *network_graph; + int64_t network_graph_ref = 0; + // WARNING: we may need a move here but no clone is available for LDKNetworkGraph + CHECK((((uintptr_t)network_graph_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&network_graph_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var); + network_graph_ref = (uintptr_t)network_graph_var.inner; + if (network_graph_var.is_owned) { + network_graph_ref |= 1; } - int8_tArray header_arr = (*env)->NewByteArray(env, 80); - (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); - int32_t height_conv = height; jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_graph_meth, network_graph_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception."); + (*env)->FatalError(env, "A call to persist_graph in LDKPersister from rust threw an exception."); } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } + return ret_conv; } -LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; +LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKMultiThreadedLockableScore * scorer) { + LDKPersister_JCalls *j_calls = (LDKPersister_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) { @@ -10441,142 +10698,113 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { } else { DO_ASSERT(get_jenv_res == JNI_OK); } + LDKMultiThreadedLockableScore scorer_var = *scorer; + int64_t scorer_ref = 0; + // WARNING: we may need a move here but no clone is available for LDKMultiThreadedLockableScore + CHECK((((uintptr_t)scorer_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&scorer_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_var); + scorer_ref = (uintptr_t)scorer_var.inner; + if (scorer_var.is_owned) { + scorer_ref |= 1; + } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_scorer_meth, scorer_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception."); - } - LDKCVec_TxidZ ret_constr; - ret_constr.datalen = (*env)->GetArrayLength(env, ret); - if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); - else - ret_constr.data = NULL; - for (size_t i = 0; i < ret_constr.datalen; i++) { - int8_tArray ret_conv_8 = (*env)->GetObjectArrayElement(env, ret, i); - LDKThirtyTwoBytes ret_conv_8_ref; - CHECK((*env)->GetArrayLength(env, ret_conv_8) == 32); - (*env)->GetByteArrayRegion(env, ret_conv_8, 0, 32, ret_conv_8_ref.data); - ret_constr.data[i] = ret_conv_8_ref; + (*env)->FatalError(env, "A call to persist_scorer in LDKPersister from rust threw an exception."); } + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } - return ret_constr; + return ret_conv; } -static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) { - LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg; +static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } -static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) { +static inline LDKPersister LDKPersister_init (JNIEnv *env, jclass clz, jobject o) { jclass c = (*env)->GetObjectClass(env, o); CHECK(c != NULL); - LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls"); + LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls"); atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->transactions_confirmed_meth = (*env)->GetMethodID(env, c, "transactions_confirmed", "([B[JI)V"); - CHECK(calls->transactions_confirmed_meth != NULL); - calls->transaction_unconfirmed_meth = (*env)->GetMethodID(env, c, "transaction_unconfirmed", "([B)V"); - CHECK(calls->transaction_unconfirmed_meth != NULL); - calls->best_block_updated_meth = (*env)->GetMethodID(env, c, "best_block_updated", "([BI)V"); - CHECK(calls->best_block_updated_meth != NULL); - calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[[B"); - CHECK(calls->get_relevant_txids_meth != NULL); + calls->persist_manager_meth = (*env)->GetMethodID(env, c, "persist_manager", "(J)J"); + CHECK(calls->persist_manager_meth != NULL); + calls->persist_graph_meth = (*env)->GetMethodID(env, c, "persist_graph", "(J)J"); + CHECK(calls->persist_graph_meth != NULL); + calls->persist_scorer_meth = (*env)->GetMethodID(env, c, "persist_scorer", "(J)J"); + CHECK(calls->persist_scorer_meth != NULL); - LDKConfirm ret = { + LDKPersister ret = { .this_arg = (void*) calls, - .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall, - .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall, - .best_block_updated = best_block_updated_LDKConfirm_jcall, - .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall, - .free = LDKConfirm_JCalls_free, + .persist_manager = persist_manager_LDKPersister_jcall, + .persist_graph = persist_graph_LDKPersister_jcall, + .persist_scorer = persist_scorer_LDKPersister_jcall, + .free = LDKPersister_JCalls_free, }; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new(JNIEnv *env, jclass clz, jobject o) { - LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *res_ptr = LDKConfirm_init(env, clz, o); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new(JNIEnv *env, jclass clz, jobject o) { + LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister"); + *res_ptr = LDKPersister_init(env, clz, o); return (uint64_t)res_ptr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); - (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; - unsigned char txid_arr[32]; - CHECK((*env)->GetArrayLength(env, txid) == 32); - (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); - unsigned char (*txid_ref)[32] = &txid_arr; - (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref); + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKChannelManager channel_manager_conv; + channel_manager_conv.inner = (void*)(channel_manager & (~1)); + channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height); + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = (void*)(network_graph & (~1)); + network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv); + return (int64_t)ret_conv; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1scorer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scorer) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; - LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKMultiThreadedLockableScore scorer_conv; + scorer_conv.inner = (void*)(scorer & (~1)); + scorer_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv); + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, &scorer_conv); + return (int64_t)ret_conv; } -typedef struct LDKPersist_JCalls { +typedef struct LDKListen_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; - jmethodID persist_new_channel_meth; - jmethodID update_persisted_channel_meth; -} LDKPersist_JCalls; -static void LDKPersist_JCalls_free(void* this_arg) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + jmethodID filtered_block_connected_meth; + jmethodID block_connected_meth; + jmethodID block_disconnected_meth; +} LDKListen_JCalls; +static void LDKListen_JCalls_free(void* this_arg) { + LDKListen_JCalls *j_calls = (LDKListen_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); @@ -10592,8 +10820,8 @@ static void LDKPersist_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; +void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) { + LDKListen_JCalls *j_calls = (LDKListen_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) { @@ -10601,14 +10829,441 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKOutPoint channel_id_var = channel_id; - int64_t channel_id_ref = 0; - CHECK((((uintptr_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = (uintptr_t)channel_id_var.inner; - if (channel_id_var.is_owned) { - channel_id_ref |= 1; + int8_tArray header_arr = (*env)->NewByteArray(env, 80); + (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); + LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata; + int64_tArray txdata_arr = NULL; + txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen); + int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL); + for (size_t c = 0; c < txdata_var.datalen; c++) { + LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *txdata_conv_28_conv = txdata_var.data[c]; + txdata_arr_ptr[c] = ((int64_t)txdata_conv_28_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0); + FREE(txdata_var.data); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->filtered_block_connected_meth, header_arr, txdata_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to filtered_block_connected in LDKListen from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { + LDKListen_JCalls *j_calls = (LDKListen_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); + } + LDKu8slice block_var = block; + int8_tArray block_arr = (*env)->NewByteArray(env, block_var.datalen); + (*env)->SetByteArrayRegion(env, block_arr, 0, block_var.datalen, block_var.data); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { + LDKListen_JCalls *j_calls = (LDKListen_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 header_arr = (*env)->NewByteArray(env, 80); + (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +static void LDKListen_JCalls_cloned(LDKListen* new_obj) { + LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->filtered_block_connected_meth = (*env)->GetMethodID(env, c, "filtered_block_connected", "([B[JI)V"); + CHECK(calls->filtered_block_connected_meth != NULL); + calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BI)V"); + CHECK(calls->block_connected_meth != NULL); + calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V"); + CHECK(calls->block_disconnected_meth != NULL); + + LDKListen ret = { + .this_arg = (void*) calls, + .filtered_block_connected = filtered_block_connected_LDKListen_jcall, + .block_connected = block_connected_LDKListen_jcall, + .block_disconnected = block_disconnected_LDKListen_jcall, + .free = LDKListen_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, jclass clz, jobject o) { + LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen"); + *res_ptr = LDKListen_init(env, clz, o); + return (uint64_t)res_ptr; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1filtered_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); + (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray block, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; + LDKu8slice block_ref; + block_ref.datalen = (*env)->GetArrayLength(env, block); + block_ref.data = (*env)->GetByteArrayElements (env, block, NULL); + (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height); + (*env)->ReleaseByteArrayElements(env, block, (int8_t*)block_ref.data, 0); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height); +} + +typedef struct LDKConfirm_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID transactions_confirmed_meth; + jmethodID transaction_unconfirmed_meth; + jmethodID best_block_updated_meth; + jmethodID get_relevant_txids_meth; +} LDKConfirm_JCalls; +static void LDKConfirm_JCalls_free(void* this_arg) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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); + } +} +void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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 header_arr = (*env)->NewByteArray(env, 80); + (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); + LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata; + int64_tArray txdata_arr = NULL; + txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen); + int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL); + for (size_t c = 0; c < txdata_var.datalen; c++) { + LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *txdata_conv_28_conv = txdata_var.data[c]; + txdata_arr_ptr[c] = ((int64_t)txdata_conv_28_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0); + FREE(txdata_var.data); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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 txid_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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 header_arr = (*env)->NewByteArray(env, 80); + (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header); + int32_t height_conv = height; + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height_conv); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_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); + jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception."); + } + LDKCVec_TxidZ ret_constr; + ret_constr.datalen = (*env)->GetArrayLength(env, ret); + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); + else + ret_constr.data = NULL; + for (size_t i = 0; i < ret_constr.datalen; i++) { + int8_tArray ret_conv_8 = (*env)->GetObjectArrayElement(env, ret, i); + LDKThirtyTwoBytes ret_conv_8_ref; + CHECK((*env)->GetArrayLength(env, ret_conv_8) == 32); + (*env)->GetByteArrayRegion(env, ret_conv_8, 0, 32, ret_conv_8_ref.data); + ret_constr.data[i] = ret_conv_8_ref; + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_constr; +} +static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) { + LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->transactions_confirmed_meth = (*env)->GetMethodID(env, c, "transactions_confirmed", "([B[JI)V"); + CHECK(calls->transactions_confirmed_meth != NULL); + calls->transaction_unconfirmed_meth = (*env)->GetMethodID(env, c, "transaction_unconfirmed", "([B)V"); + CHECK(calls->transaction_unconfirmed_meth != NULL); + calls->best_block_updated_meth = (*env)->GetMethodID(env, c, "best_block_updated", "([BI)V"); + CHECK(calls->best_block_updated_meth != NULL); + calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[[B"); + CHECK(calls->get_relevant_txids_meth != NULL); + + LDKConfirm ret = { + .this_arg = (void*) calls, + .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall, + .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall, + .best_block_updated = best_block_updated_LDKConfirm_jcall, + .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall, + .free = LDKConfirm_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new(JNIEnv *env, jclass clz, jobject o) { + LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *res_ptr = LDKConfirm_init(env, clz, o); + return (uint64_t)res_ptr; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); + (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; + unsigned char txid_arr[32]; + CHECK((*env)->GetArrayLength(env, txid) == 32); + (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); + unsigned char (*txid_ref)[32] = &txid_arr; + (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height); +} + +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); + if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } + LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; + LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; +} + +typedef struct LDKPersist_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID persist_new_channel_meth; + jmethodID update_persisted_channel_meth; +} LDKPersist_JCalls; +static void LDKPersist_JCalls_free(void* this_arg) { + LDKPersist_JCalls *j_calls = (LDKPersist_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_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + 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); + } + LDKOutPoint channel_id_var = channel_id; + int64_t channel_id_ref = 0; + CHECK((((uintptr_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = (uintptr_t)channel_id_var.inner; + if (channel_id_var.is_owned) { + channel_id_ref |= 1; } LDKChannelMonitor data_var = *data; int64_t data_ref = 0; @@ -10798,7 +11453,7 @@ typedef struct LDKChannelMessageHandler_JCalls { jmethodID handle_accept_channel_meth; jmethodID handle_funding_created_meth; jmethodID handle_funding_signed_meth; - jmethodID handle_funding_locked_meth; + jmethodID handle_channel_ready_meth; jmethodID handle_shutdown_meth; jmethodID handle_closing_signed_meth; jmethodID handle_update_add_htlc_meth; @@ -10978,7 +11633,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } } -void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) { +void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) { 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); @@ -10989,9 +11644,9 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, } int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form); - LDKFundingLocked msg_var = *msg; + LDKChannelReady msg_var = *msg; int64_t msg_ref = 0; - msg_var = FundingLocked_clone(&msg_var); + msg_var = ChannelReady_clone(&msg_var); CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); @@ -11001,10 +11656,10 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref); + (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_ready_meth, their_node_id_arr, msg_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to handle_funding_locked in LDKChannelMessageHandler from rust threw an exception."); + (*env)->FatalError(env, "A call to handle_channel_ready in LDKChannelMessageHandler from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -11511,8 +12166,8 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *en CHECK(calls->handle_funding_created_meth != NULL); calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "([BJ)V"); CHECK(calls->handle_funding_signed_meth != NULL); - calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "([BJ)V"); - CHECK(calls->handle_funding_locked_meth != NULL); + calls->handle_channel_ready_meth = (*env)->GetMethodID(env, c, "handle_channel_ready", "([BJ)V"); + CHECK(calls->handle_channel_ready_meth != NULL); calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJJ)V"); CHECK(calls->handle_shutdown_meth != NULL); calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "([BJ)V"); @@ -11550,7 +12205,7 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *en .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall, .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall, .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall, - .handle_funding_locked = handle_funding_locked_LDKChannelMessageHandler_jcall, + .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall, .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall, .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall, .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall, @@ -11649,18 +12304,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)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); - LDKFundingLocked msg_conv; + LDKChannelReady msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); + (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) { @@ -12991,288 +13646,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1 default: abort(); } } -typedef struct LDKScore_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID channel_penalty_msat_meth; - jmethodID payment_path_failed_meth; - jmethodID payment_path_successful_meth; - jmethodID write_meth; -} LDKScore_JCalls; -static void LDKScore_JCalls_free(void* this_arg) { - LDKScore_JCalls *j_calls = (LDKScore_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); - } -} -uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, uint64_t capacity_msat, const LDKNodeId * source, const LDKNodeId * target) { - LDKScore_JCalls *j_calls = (LDKScore_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); - } - int64_t short_channel_id_conv = short_channel_id; - int64_t send_amt_msat_conv = send_amt_msat; - int64_t capacity_msat_conv = capacity_msat; - LDKNodeId source_var = *source; - int64_t source_ref = 0; - source_var = NodeId_clone(&source_var); - CHECK((((uintptr_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); - source_ref = (uintptr_t)source_var.inner; - if (source_var.is_owned) { - source_ref |= 1; - } - LDKNodeId target_var = *target; - int64_t target_ref = 0; - target_var = NodeId_clone(&target_var); - CHECK((((uintptr_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); - target_ref = (uintptr_t)target_var.inner; - if (target_var.is_owned) { - target_ref |= 1; - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id_conv, send_amt_msat_conv, capacity_msat_conv, source_ref, target_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret; -} -void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { - LDKScore_JCalls *j_calls = (LDKScore_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); - } - LDKCVec_RouteHopZ path_var = path; - int64_tArray path_arr = NULL; - path_arr = (*env)->NewLongArray(env, path_var.datalen); - int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - int64_t path_conv_10_ref = 0; - CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; - if (path_conv_10_var.is_owned) { - path_conv_10_ref |= 1; - } - path_arr_ptr[k] = path_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); - FREE(path_var.data); - int64_t short_channel_id_conv = short_channel_id; - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_arr, short_channel_id_conv); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) { - LDKScore_JCalls *j_calls = (LDKScore_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); - } - LDKCVec_RouteHopZ path_var = path; - int64_tArray path_arr = NULL; - path_arr = (*env)->NewLongArray(env, path_var.datalen); - int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - int64_t path_conv_10_ref = 0; - CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; - if (path_conv_10_var.is_owned) { - path_conv_10_ref |= 1; - } - path_arr_ptr[k] = path_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); - FREE(path_var.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception."); - } - LDKCVec_u8Z ret_ref; - ret_ref.datalen = (*env)->GetArrayLength(env, ret); - ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_ref; -} -static void LDKScore_JCalls_cloned(LDKScore* new_obj) { - LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKScore LDKScore_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJJ)J"); - CHECK(calls->channel_penalty_msat_meth != NULL); - calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "([JJ)V"); - CHECK(calls->payment_path_failed_meth != NULL); - calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "([J)V"); - CHECK(calls->payment_path_successful_meth != NULL); - calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B"); - CHECK(calls->write_meth != NULL); - - LDKScore ret = { - .this_arg = (void*) calls, - .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall, - .payment_path_failed = payment_path_failed_LDKScore_jcall, - .payment_path_successful = payment_path_successful_LDKScore_jcall, - .write = write_LDKScore_jcall, - .free = LDKScore_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKScore_1new(JNIEnv *env, jclass clz, jobject o) { - LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore"); - *res_ptr = LDKScore_init(env, clz, o); - return (uint64_t)res_ptr; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t send_amt_msat, int64_t capacity_msat, int64_t source, int64_t target) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKNodeId source_conv; - source_conv.inner = (void*)(source & (~1)); - source_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - LDKNodeId target_conv; - target_conv.inner = (void*)(target & (~1)); - target_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, send_amt_msat, capacity_msat, &source_conv, &target_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = (*env)->GetArrayLength(env, path); - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); - for (size_t k = 0; k < path_constr.datalen; k++) { - int64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); - path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); - (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = (*env)->GetArrayLength(env, path); - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); - for (size_t k = 0; k < path_constr.datalen; k++) { - int64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); - path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); - (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - typedef struct LDKLockableScore_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -13360,155 +13733,56 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock(JNIEnv return (int64_t)ret_ret; } -typedef struct LDKPersister_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID persist_manager_meth; - jmethodID persist_graph_meth; -} LDKPersister_JCalls; -static void LDKPersister_JCalls_free(void* this_arg) { - LDKPersister_JCalls *j_calls = (LDKPersister_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); +static jclass LDKGossipSync_P2P_class = NULL; +static jmethodID LDKGossipSync_P2P_meth = NULL; +static jclass LDKGossipSync_Rapid_class = NULL; +static jmethodID LDKGossipSync_Rapid_meth = NULL; +static jclass LDKGossipSync_None_class = NULL; +static jmethodID LDKGossipSync_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGossipSync_init (JNIEnv *env, jclass clz) { + LDKGossipSync_P2P_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$P2P")); + CHECK(LDKGossipSync_P2P_class != NULL); + LDKGossipSync_P2P_meth = (*env)->GetMethodID(env, LDKGossipSync_P2P_class, "", "(J)V"); + CHECK(LDKGossipSync_P2P_meth != NULL); + LDKGossipSync_Rapid_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$Rapid")); + CHECK(LDKGossipSync_Rapid_class != NULL); + LDKGossipSync_Rapid_meth = (*env)->GetMethodID(env, LDKGossipSync_Rapid_class, "", "(J)V"); + CHECK(LDKGossipSync_Rapid_meth != NULL); + LDKGossipSync_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$None")); + CHECK(LDKGossipSync_None_class != NULL); + LDKGossipSync_None_meth = (*env)->GetMethodID(env, LDKGossipSync_None_class, "", "()V"); + CHECK(LDKGossipSync_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGossipSync_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKGossipSync *obj = (LDKGossipSync*)(ptr & ~1); + switch(obj->tag) { + case LDKGossipSync_P2P: { + LDKP2PGossipSync p2p_var = obj->p2p; + int64_t p2p_ref = 0; + CHECK((((uintptr_t)p2p_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&p2p_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var); + p2p_ref = (uintptr_t)p2p_var.inner & ~1; + return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref); } - (*env)->DeleteWeakGlobalRef(env, j_calls->o); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + case LDKGossipSync_Rapid: { + LDKRapidGossipSync rapid_var = obj->rapid; + int64_t rapid_ref = 0; + CHECK((((uintptr_t)rapid_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&rapid_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var); + rapid_ref = (uintptr_t)rapid_var.inner & ~1; + return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref); } - FREE(j_calls); - } -} -LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) { - LDKPersister_JCalls *j_calls = (LDKPersister_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); - } - LDKChannelManager channel_manager_var = *channel_manager; - int64_t channel_manager_ref = 0; - // WARNING: we may need a move here but no clone is available for LDKChannelManager - CHECK((((uintptr_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); - channel_manager_ref = (uintptr_t)channel_manager_var.inner; - if (channel_manager_var.is_owned) { - channel_manager_ref |= 1; - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to persist_manager in LDKPersister from rust threw an exception."); - } - void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); - FREE((void*)ret); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) { - LDKPersister_JCalls *j_calls = (LDKPersister_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); - } - LDKNetworkGraph network_graph_var = *network_graph; - int64_t network_graph_ref = 0; - network_graph_var = NetworkGraph_clone(&network_graph_var); - CHECK((((uintptr_t)network_graph_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&network_graph_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var); - network_graph_ref = (uintptr_t)network_graph_var.inner; - if (network_graph_var.is_owned) { - network_graph_ref |= 1; - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_graph_meth, network_graph_ref); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to persist_graph in LDKPersister from rust threw an exception."); - } - void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr); - FREE((void*)ret); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + case LDKGossipSync_None: { + return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth); + } + default: abort(); } - return ret_conv; } -static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKPersister LDKPersister_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->persist_manager_meth = (*env)->GetMethodID(env, c, "persist_manager", "(J)J"); - CHECK(calls->persist_manager_meth != NULL); - calls->persist_graph_meth = (*env)->GetMethodID(env, c, "persist_graph", "(J)J"); - CHECK(calls->persist_graph_meth != NULL); - - LDKPersister ret = { - .this_arg = (void*) calls, - .persist_manager = persist_manager_LDKPersister_jcall, - .persist_graph = persist_graph_LDKPersister_jcall, - .free = LDKPersister_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new(JNIEnv *env, jclass clz, jobject o) { - LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister"); - *res_ptr = LDKPersister_init(env, clz, o); - return (uint64_t)res_ptr; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - LDKChannelManager channel_manager_conv; - channel_manager_conv.inner = (void*)(channel_manager & (~1)); - channel_manager_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) { - void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); - if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = (void*)(network_graph & (~1)); - network_graph_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv); - return (int64_t)ret_conv; -} - static jclass LDKFallback_SegWitProgram_class = NULL; static jmethodID LDKFallback_SegWitProgram_meth = NULL; static jclass LDKFallback_PubKeyHash_class = NULL; @@ -14069,6 +14343,36 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv return (int64_t)ret_conv; } +static jclass LDKRetry_Attempts_class = NULL; +static jmethodID LDKRetry_Attempts_meth = NULL; +static jclass LDKRetry_Timeout_class = NULL; +static jmethodID LDKRetry_Timeout_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) { + LDKRetry_Attempts_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts")); + CHECK(LDKRetry_Attempts_class != NULL); + LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "", "(J)V"); + CHECK(LDKRetry_Attempts_meth != NULL); + LDKRetry_Timeout_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout")); + CHECK(LDKRetry_Timeout_class != NULL); + LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "", "(J)V"); + CHECK(LDKRetry_Timeout_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKRetry *obj = (LDKRetry*)(ptr & ~1); + switch(obj->tag) { + case LDKRetry_Attempts: { + int64_t attempts_conv = obj->attempts; + return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv); + } + case LDKRetry_Timeout: { + int64_t timeout_conv = obj->timeout; + return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv); + } + default: abort(); + } +} JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) { LDKStr ret_str = _ldk_get_compiled_version(); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); @@ -15743,244 +16047,77 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); - o_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)o) & ~1)); - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKAccessError e_conv = LDKAccessError_from_java(env, e); - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1); - jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr); - FREE((void*)_res); - CResult_TxOutAccessErrorZ_free(_res_conv); -} - -static inline uintptr_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); - LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); - *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -static inline uintptr_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { - LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); - LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { - LDKTransaction b_ref; - b_ref.datalen = (*env)->GetArrayLength(env, b); - b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data); - b_ref.data_is_owned = true; - LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); - *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref); - return ((int64_t)ret_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr); - FREE((void*)_res); - C2Tuple_usizeTransactionZ_free(_res_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_usizeTransactionZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t c = 0; c < _res_constr.datalen; c++) { - int64_t _res_conv_28 = _res_vals[c]; - void* _res_conv_28_ptr = (void*)(((uintptr_t)_res_conv_28) & ~1); - CHECK_ACCESS(_res_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr); - FREE((void*)_res_conv_28); - _res_constr.data[c] = _res_conv_28_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_usizeTransactionZZ_free(_res_constr); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxidZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_TxidZ _res_constr; +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(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); + _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); - LDKThirtyTwoBytes _res_conv_8_ref; - CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data); + 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_TxidZ_free(_res_constr); + CVec_PublicKeyZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr); + o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uintptr_t)o) & ~1)); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_java(env, e); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1); - jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr); + LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); + CResult_PaymentPurposeDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); +static inline uintptr_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); - int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); - LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); - *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)(orig & ~1); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_MonitorEventZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - void* _res_conv_14_ptr = (void*)(((uintptr_t)_res_conv_14) & ~1); - CHECK_ACCESS(_res_conv_14_ptr); - LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr); - FREE((void*)_res_conv_14); - _res_constr.data[o] = _res_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_MonitorEventZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr); - o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)o) & ~1)); - LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); - *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); - *ret_copy = COption_C2Tuple_usizeTransactionZZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr); - FREE((void*)_res); - COption_C2Tuple_usizeTransactionZZ_free(_res_conv); -} - -static inline uintptr_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { - LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); - *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; - int64_t ret_conv = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; - LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); - *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -16270,238 +16407,476 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free( CVec_MessageSendEventZ_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 = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = FixedPenaltyScorer_clone(&o_conv); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); + o_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)o) & ~1)); + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKAccessError e_conv = LDKAccessError_from_java(env, e); + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1); + jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr); + LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv); + CResult_TxOutAccessErrorZ_free(_res_conv); } -static inline uintptr_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(orig & ~1); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKScoringParameters o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ScoringParameters_clone(&o_conv); - LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { + LDKTransaction b_ref; + b_ref.datalen = (*env)->GetArrayLength(env, b); + b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data); + b_ref.data_is_owned = true; + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr); FREE((void*)_res); - CResult_ScoringParametersDecodeErrorZ_free(_res_conv); + C2Tuple_usizeTransactionZ_free(_res_conv); } -static inline uintptr_t CResult_ScoringParametersDecodeErrorZ_clone_ptr(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = CResult_ScoringParametersDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ScoringParametersDecodeErrorZ* arg_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ScoringParametersDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_usizeTransactionZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t c = 0; c < _res_constr.datalen; c++) { + int64_t _res_conv_28 = _res_vals[c]; + void* _res_conv_28_ptr = (void*)(((uintptr_t)_res_conv_28) & ~1); + CHECK_ACCESS(_res_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr); + FREE((void*)_res_conv_28); + _res_constr.data[c] = _res_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_usizeTransactionZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ScoringParametersDecodeErrorZ* orig_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(orig & ~1); - LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = CResult_ScoringParametersDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxidZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_TxidZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ 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); + LDKThirtyTwoBytes _res_conv_8_ref; + CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_TxidZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKScorer o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKScorer - LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); - *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok(); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); - *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_java(env, e); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ScorerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1); + jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr); + LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr); FREE((void*)_res); - CResult_ScorerDecodeErrorZ_free(_res_conv); + CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKProbabilisticScorer o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv); +static inline uintptr_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); return (int64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); + int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_MonitorEventZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_14 = _res_vals[o]; + void* _res_conv_14_ptr = (void*)(((uintptr_t)_res_conv_14) & ~1); + CHECK_ACCESS(_res_conv_14_ptr); + LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr); + FREE((void*)_res_conv_14); + _res_constr.data[o] = _res_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_MonitorEventZ_free(_res_constr); +} + +static inline uintptr_t C2Tuple_OutPointCVec_MonitorEventZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorEventZZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OutPointCVec_MonitorEventZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(orig & ~1); + LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_clone(orig_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKCVec_MonitorEventZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t o = 0; o < b_constr.datalen; o++) { + int64_t b_conv_14 = b_vals[o]; + void* b_conv_14_ptr = (void*)(((uintptr_t)b_conv_14) & ~1); + CHECK_ACCESS(b_conv_14_ptr); + LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr); + b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)b_conv_14) & ~1)); + b_constr.data[o] = b_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + LDKC2Tuple_OutPointCVec_MonitorEventZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKC2Tuple_OutPointCVec_MonitorEventZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorEventZZ_new(a_conv, b_constr); + return ((int64_t)ret_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_OutPointCVec_MonitorEventZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(_res_ptr); FREE((void*)_res); - CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); + C2Tuple_OutPointCVec_MonitorEventZZ_free(_res_conv); } -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 = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - 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 (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorEventZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorEventZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t m = 0; m < _res_constr.datalen; m++) { + int64_t _res_conv_38 = _res_vals[m]; + void* _res_conv_38_ptr = (void*)(((uintptr_t)_res_conv_38) & ~1); + CHECK_ACCESS(_res_conv_38_ptr); + LDKC2Tuple_OutPointCVec_MonitorEventZZ _res_conv_38_conv = *(LDKC2Tuple_OutPointCVec_MonitorEventZZ*)(_res_conv_38_ptr); + FREE((void*)_res_conv_38); + _res_constr.data[m] = _res_conv_38_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr); + o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)o) & ~1)); + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -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*)(o & ~1); - jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); + LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr); FREE((void*)_res); - CResult_InitFeaturesDecodeErrorZ_free(_res_conv); + COption_C2Tuple_usizeTransactionZZ_free(_res_conv); } -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 = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - 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 (int64_t)ret_conv; +static inline uintptr_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } - +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; + int64_t ret_conv = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +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 = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = FixedPenaltyScorer_clone(&o_conv); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv); +} + +static inline uintptr_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(orig & ~1); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKProbabilisticScorer o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); + *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); +} + +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 = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + 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 (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +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*)(o & ~1); + 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 ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_InitFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uintptr_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 (int64_t)ret_conv; +} +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*)(arg & ~1); + 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*)(orig & ~1); + LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); + *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +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 = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + 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 (int64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); @@ -16528,6 +16903,24 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecode CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv); } +static inline uintptr_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 (int64_t)ret_conv; +} +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*)(arg & ~1); + 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*)(orig & ~1); + LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + 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 = (void*)(o & (~1)); @@ -16565,6 +16958,24 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErr CResult_NodeFeaturesDecodeErrorZ_free(_res_conv); } +static inline uintptr_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 (int64_t)ret_conv; +} +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*)(arg & ~1); + 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*)(orig & ~1); + LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); + *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKInvoiceFeatures o_conv; o_conv.inner = (void*)(o & (~1)); @@ -16602,6 +17013,24 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecode CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv); } +static inline uintptr_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(orig & ~1); + LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + 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 = (void*)(o & (~1)); @@ -16639,4368 +17068,4400 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDe CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKDelayedPaymentOutputDescriptor o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); - FREE((void*)_res); - CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); -} - -static inline uintptr_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); +static inline uintptr_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 (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); +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*)(arg & ~1); + int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_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*)(orig & ~1); + LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); + *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKStaticPaymentOutputDescriptor o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); + o_conv = NodeId_clone(&o_conv); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); + LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); + CResult_NodeIdDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); - LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr); - o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)o) & ~1)); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv); + LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); + o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uintptr_t)o) & ~1)); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); + CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_PaymentPreimageZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ 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); - LDKThirtyTwoBytes _res_conv_8_ref; - CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data); - _res_constr.data[i] = _res_conv_8_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKAccess o_conv = *(LDKAccess*)(o_ptr); + if (o_conv.free == LDKAccess_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKAccess_JCalls_cloned(&o_conv); } - CVec_PaymentPreimageZ_free(_res_constr); -} - -static inline uintptr_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { - LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); - *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); - LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); - *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv); - return ((int64_t)ret_conv); + LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); + *ret_copy = COption_AccessZ_some(o_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) { - LDKSignature a_ref; - CHECK((*env)->GetArrayLength(env, a) == 64); - (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form); - LDKCVec_SignatureZ b_constr; - b_constr.datalen = (*env)->GetArrayLength(env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - b_constr.data = NULL; - for (size_t i = 0; i < b_constr.datalen; i++) { - int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i); - LDKSignature b_conv_8_ref; - CHECK((*env)->GetArrayLength(env, b_conv_8) == 64); - (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form); - b_constr.data[i] = b_conv_8_ref; - } - LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); - *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); + *ret_copy = COption_AccessZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr); + LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv); + COption_AccessZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr); - o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_ok(o); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKLightningError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = LightningError_clone(&e_conv); + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1); + jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr); + LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); + CResult_boolLightningErrorZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); +static inline uintptr_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKSignature o_ref; - CHECK((*env)->GetArrayLength(env, o) == 64); - (*env)->GetByteArrayRegion(env, o, 0, 64, o_ref.compact_form); - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_err(); - return (int64_t)ret_conv; +static inline uintptr_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); + return ((int64_t)ret_conv); } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1); - jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); + int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr); - FREE((void*)_res); - CResult_SignatureNoneZ_free(_res_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv); + return ((int64_t)ret_conv); } -static inline uintptr_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv); - return ret_conv; -} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { + LDKChannelAnnouncement a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = ChannelAnnouncement_clone(&a_conv); + LDKChannelUpdate b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ChannelUpdate_clone(&b_conv); + LDKChannelUpdate c_conv; + c_conv.inner = (void*)(c & (~1)); + c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = ChannelUpdate_clone(&c_conv); + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); + return ((int64_t)ret_conv); +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); - LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); - *ret_conv = CResult_SignatureNoneZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr); + FREE((void*)_res); + C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv); } -static inline uintptr_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) { - LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); - *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg); - return ((int64_t)ret_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t h = 0; h < _res_constr.datalen; h++) { + int64_t _res_conv_59 = _res_vals[h]; + void* _res_conv_59_ptr = (void*)(((uintptr_t)_res_conv_59) & ~1); + CHECK_ACCESS(_res_conv_59_ptr); + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr); + FREE((void*)_res_conv_59); + _res_constr.data[h] = _res_conv_59_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_NodeAnnouncementZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t s = 0; s < _res_constr.datalen; s++) { + int64_t _res_conv_18 = _res_vals[s]; + LDKNodeAnnouncement _res_conv_18_conv; + _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1)); + _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv); + _res_constr.data[s] = _res_conv_18_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_NodeAnnouncementZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)(orig & ~1); - LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); - *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_ok(); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { - LDKSignature a_ref; - CHECK((*env)->GetArrayLength(env, a) == 64); - (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form); - LDKSignature b_ref; - CHECK((*env)->GetArrayLength(env, b) == 64); - (*env)->GetByteArrayRegion(env, b, 0, 64, b_ref.compact_form); - LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); - *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKLightningError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = LightningError_clone(&e_conv); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr); + LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_SignatureSignatureZ_free(_res_conv); + CResult_NoneLightningErrorZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr); - o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv); +static inline uintptr_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelUpdateInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelUpdateInfo_clone(&o_conv); + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr); + LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv); + CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg); +static inline uintptr_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(orig & ~1); - LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); - *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKSecretKey o_ref; - CHECK((*env)->GetArrayLength(env, o) == 32); - (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes); - LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); - *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelInfo_clone(&o_conv); + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); - *ret_conv = CResult_SecretKeyNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)(o & ~1); - jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr); + LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SecretKeyNoneZ_free(_res_conv); + CResult_ChannelInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) { - LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); - *ret_conv = CResult_SecretKeyNoneZ_clone(arg); +static inline uintptr_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)(orig & ~1); - LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); - *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKSign o_conv = *(LDKSign*)(o_ptr); - if (o_conv.free == LDKSign_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSign_JCalls_cloned(&o_conv); - } - LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); - *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRoutingFees o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = RoutingFees_clone(&o_conv); + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); - *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr); + LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SignDecodeErrorZ_free(_res_conv); + CResult_RoutingFeesDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); - *ret_conv = CResult_SignDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); - LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); - *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_u5Z _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_NetAddressZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else _res_constr.data = NULL; - int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int8_t _res_conv_7 = _res_vals[h]; - - _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 }; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t m = 0; m < _res_constr.datalen; m++) { + int64_t _res_conv_12 = _res_vals[m]; + void* _res_conv_12_ptr = (void*)(((uintptr_t)_res_conv_12) & ~1); + CHECK_ACCESS(_res_conv_12_ptr); + LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr); + FREE((void*)_res_conv_12); + _res_constr.data[m] = _res_conv_12_conv; } - (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0); - CVec_u5Z_free(_res_constr); + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_NetAddressZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKRecoverableSignature o_ref; - CHECK((*env)->GetArrayLength(env, o) == 68); - (*env)->GetByteArrayRegion(env, o, 0, 68, o_ref.serialized_form); - LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeAnnouncementInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = NodeAnnouncementInfo_clone(&o_conv); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = CResult_RecoverableSignatureNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1); - jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_RecoverableSignatureNoneZ_free(_res_conv); + CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { - LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); +static inline uintptr_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); - LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); - *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv *env, jclass clz, int8_tArray _res) { - LDKCVec_u8Z _res_ref; - _res_ref.datalen = (*env)->GetArrayLength(env, _res); - _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); - CVec_u8Z_free(_res_ref); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_CVec_u8ZZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_u64Z _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z 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); - LDKCVec_u8Z _res_conv_8_ref; - _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8); - _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data); - _res_constr.data[i] = _res_conv_8_ref; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t g = 0; g < _res_constr.datalen; g++) { + int64_t _res_conv_6 = _res_vals[g]; + _res_constr.data[g] = _res_conv_6; } - CVec_CVec_u8ZZ_free(_res_constr); + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_u64Z_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) { - LDKCVec_CVec_u8ZZ o_constr; - o_constr.datalen = (*env)->GetArrayLength(env, o); - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); - else - o_constr.data = NULL; - for (size_t i = 0; i < o_constr.datalen; i++) { - int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i); - LDKCVec_u8Z o_conv_8_ref; - o_conv_8_ref.datalen = (*env)->GetArrayLength(env, o_conv_8); - o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, o_conv_8, 0, o_conv_8_ref.datalen, o_conv_8_ref.data); - o_constr.data[i] = o_conv_8_ref; - } - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNodeInfo o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = NodeInfo_clone(&o_conv); + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1); - jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr); + LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); + CResult_NodeInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); +static inline uintptr_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInMemorySigner o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKNetworkGraph o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = InMemorySigner_clone(&o_conv); - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); + // WARNING: we need a move here but no clone is available for LDKNetworkGraph + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr); + LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_InMemorySignerDecodeErrorZ_free(_res_conv); + CResult_NetworkGraphDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_NetAddressZ o_constr; + o_constr.datalen = (*env)->GetArrayLength(env, o); + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); + for (size_t m = 0; m < o_constr.datalen; m++) { + int64_t o_conv_12 = o_vals[m]; + void* o_conv_12_ptr = (void*)(((uintptr_t)o_conv_12) & ~1); + CHECK_ACCESS(o_conv_12_ptr); + LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr); + o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o_conv_12) & ~1)); + o_constr.data[m] = o_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_some(o_constr); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr); + FREE((void*)_res); + COption_CVec_NetAddressZZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_TxOutZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int64_t _res_conv_7 = _res_vals[h]; - void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); - CHECK_ACCESS(_res_conv_7_ptr); - LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr); - FREE((void*)_res_conv_7); - _res_constr.data[h] = _res_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_TxOutZ_free(_res_constr); +static inline uintptr_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; + int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKTransaction o_ref; - o_ref.datalen = (*env)->GetArrayLength(env, o); - o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data); - o_ref.data_is_owned = true; - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKDelayedPaymentOutputDescriptor o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1); - jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_TransactionNoneZ_free(_res_conv); + CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_clone(arg); +static inline uintptr_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { - LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); - *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKStaticPaymentOutputDescriptor o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); - LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); - *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKChannelMonitor b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = (b & 1) || (b == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = ChannelMonitor_clone(&b_conv); - LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); - *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_BlockHashChannelMonitorZ_free(_res_conv); + CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t j = 0; j < _res_constr.datalen; j++) { - int64_t _res_conv_35 = _res_vals[j]; - void* _res_conv_35_ptr = (void*)(((uintptr_t)_res_conv_35) & ~1); - CHECK_ACCESS(_res_conv_35_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr); - FREE((void*)_res_conv_35); - _res_constr.data[j] = _res_conv_35_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_BlockHashChannelMonitorZZ_free(_res_constr); +static inline uintptr_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { - LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o_constr; - o_constr.datalen = (*env)->GetArrayLength(env, o); - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements"); - else - o_constr.data = NULL; - int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - for (size_t j = 0; j < o_constr.datalen; j++) { - int64_t o_conv_35 = o_vals[j]; - void* o_conv_35_ptr = (void*)(((uintptr_t)o_conv_35) & ~1); - CHECK_ACCESS(o_conv_35_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr); - o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o_conv_35) & ~1)); - o_constr.data[j] = o_conv_35_conv; - } - (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKIOError e_conv = LDKIOError_from_java(env, e); - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr); + o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)o) & ~1)); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1); - jboolean ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); + CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) { - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg); +static inline uintptr_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1); - LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); - *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) { - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = COption_u16Z_some(o); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_PaymentPreimageZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ 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); + LDKThirtyTwoBytes _res_conv_8_ref; + CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_PaymentPreimageZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none(JNIEnv *env, jclass clz) { - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = COption_u16Z_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); + return ((int64_t)ret_conv); } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr); - FREE((void*)_res); - COption_u16Z_free(_res_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); + return ret_conv; } -static inline uintptr_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = COption_u16Z_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; - int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) { + LDKSignature a_ref; + CHECK((*env)->GetArrayLength(env, a) == 64); + (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form); + LDKCVec_SignatureZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + b_constr.data = NULL; + for (size_t i = 0; i < b_constr.datalen; i++) { + int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i); + LDKSignature b_conv_8_ref; + CHECK((*env)->GetArrayLength(env, b_conv_8) == 64); + (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form); + b_constr.data[i] = b_conv_8_ref; + } + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr); + return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = COption_u16Z_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr); + FREE((void*)_res); + C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv); } -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_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr); + o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); return (int64_t)ret_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*)(o & ~1); - jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_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_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_NoneAPIErrorZ_free(_res_conv); + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); } -static inline uintptr_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 uintptr_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); return (int64_t)ret_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*)(arg & ~1); - int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_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*)(orig & ~1); - 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_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv); return (int64_t)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; - _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"); - 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 = (void*)(((uintptr_t)_res_conv_22) & ~1); - CHECK_ACCESS(_res_conv_22_ptr); - LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr); - FREE((void*)_res_conv_22); - _res_constr.data[w] = _res_conv_22_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_CResult_NoneAPIErrorZZ_free(_res_constr); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_APIErrorZ _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"); - 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 = (void*)(((uintptr_t)_res_conv_10) & ~1); - CHECK_ACCESS(_res_conv_10_ptr); - LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr); - FREE((void*)_res_conv_10); - _res_constr.data[k] = _res_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_APIErrorZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_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__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = CResult__u832APIErrorZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKSignature o_ref; + CHECK((*env)->GetArrayLength(env, o) == 64); + (*env)->GetByteArrayRegion(env, o, 0, 64, o_ref.compact_form); + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = CResult__u832APIErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1); - jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1); + jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr); + LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr); FREE((void*)_res); - CResult__u832APIErrorZ_free(_res_conv); + CResult_SignatureNoneZ_free(_res_conv); } -static inline uintptr_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { - LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = CResult__u832APIErrorZ_clone(arg); +static inline uintptr_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); - int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); - LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = CResult__u832APIErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) { + LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); + *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)(orig & ~1); + LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); + *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { + LDKSignature a_ref; + CHECK((*env)->GetArrayLength(env, a) == 64); + (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form); + LDKSignature b_ref; + CHECK((*env)->GetArrayLength(env, b) == 64); + (*env)->GetByteArrayRegion(env, b, 0, 64, b_ref.compact_form); + LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ"); + *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr); + LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); -} - -static inline uintptr_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv); - return (int64_t)ret_conv; + C2Tuple_SignatureSignatureZ_free(_res_conv); } -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_1C2Tuple_1SignatureSignatureZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr); + o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err(); return (int64_t)ret_conv; } -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*)(o & ~1); - jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_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_1C2Tuple_1SignatureSignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); + LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_NonePaymentSendFailureZ_free(_res_conv); + CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv); } -static inline uintptr_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 uintptr_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg); return (int64_t)ret_conv; } -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*)(arg & ~1); - int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_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*)(orig & ~1); - 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_1C2Tuple_1SignatureSignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(orig & ~1); + LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { - LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); - *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKSecretKey o_ref; + CHECK((*env)->GetArrayLength(env, o) == 32); + (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes); + LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); + *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); - LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); - *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); + *ret_conv = CResult_SecretKeyNoneZ_err(); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKThirtyTwoBytes b_ref; - CHECK((*env)->GetArrayLength(env, b) == 32); - (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); - LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); - *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)(o & ~1); + jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr); + LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_PaymentHashPaymentIdZ_free(_res_conv); + CResult_SecretKeyNoneZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +static inline uintptr_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) { + LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); + *ret_conv = CResult_SecretKeyNoneZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)(orig & ~1); + LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ"); + *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); - LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv); + LDKSign o_conv = *(LDKSign*)(o_ptr); + if (o_conv.free == LDKSign_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSign_JCalls_cloned(&o_conv); + } + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr); + LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv); + CResult_SignDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); +static inline uintptr_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_NetAddressZ _res_constr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_u5Z _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); else _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t m = 0; m < _res_constr.datalen; m++) { - int64_t _res_conv_12 = _res_vals[m]; - void* _res_conv_12_ptr = (void*)(((uintptr_t)_res_conv_12) & ~1); - CHECK_ACCESS(_res_conv_12_ptr); - LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr); - FREE((void*)_res_conv_12); - _res_constr.data[m] = _res_conv_12_conv; + int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL); + for (size_t h = 0; h < _res_constr.datalen; h++) { + int8_t _res_conv_7 = _res_vals[h]; + + _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 }; } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_NetAddressZ_free(_res_constr); -} - -static inline uintptr_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { - LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); - *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); - LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); - *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKThirtyTwoBytes b_ref; - CHECK((*env)->GetArrayLength(env, b) == 32); - (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); - LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); - *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref); - return ((int64_t)ret_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr); - FREE((void*)_res); - C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv); + (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0); + CVec_u5Z_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKRecoverableSignature o_ref; + CHECK((*env)->GetArrayLength(env, o) == 68); + (*env)->GetByteArrayRegion(env, o, 0, 68, o_ref.serialized_form); + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1); + jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr); + LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv); + CResult_RecoverableSignatureNoneZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg); +static inline uintptr_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv *env, jclass clz, int8_tArray _res) { + LDKCVec_u8Z _res_ref; + _res_ref.datalen = (*env)->GetArrayLength(env, _res); + _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); + CVec_u8Z_free(_res_ref); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_CVec_u8ZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ 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); + LDKCVec_u8Z _res_conv_8_ref; + _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8); + _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_CVec_u8ZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) { + LDKCVec_CVec_u8ZZ o_constr; + o_constr.datalen = (*env)->GetArrayLength(env, o); + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); + else + o_constr.data = NULL; + for (size_t i = 0; i < o_constr.datalen; i++) { + int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i); + LDKCVec_u8Z o_conv_8_ref; + o_conv_8_ref.datalen = (*env)->GetArrayLength(env, o_conv_8); + o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, o_conv_8, 0, o_conv_8_ref.datalen, o_conv_8_ref.data); + o_constr.data[i] = o_conv_8_ref; + } + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1); + jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr); + LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv); + CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg); +static inline uintptr_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_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_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInMemorySigner o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = InMemorySigner_clone(&o_conv); + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = CResult_PaymentSecretNoneZ_err(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr); + LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentSecretNoneZ_free(_res_conv); + CResult_InMemorySignerDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) { - LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = CResult_PaymentSecretNoneZ_clone(arg); +static inline uintptr_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1); - LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_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_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_TxOutZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t h = 0; h < _res_constr.datalen; h++) { + int64_t _res_conv_7 = _res_vals[h]; + void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); + CHECK_ACCESS(_res_conv_7_ptr); + LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr); + FREE((void*)_res_conv_7); + _res_constr.data[h] = _res_conv_7_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_TxOutZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKTransaction o_ref; + o_ref.datalen = (*env)->GetArrayLength(env, o); + o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data); + o_ref.data_is_owned = true; + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1); + jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr); + LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentSecretAPIErrorZ_free(_res_conv); + CResult_TransactionNoneZ_free(_res_conv); } -static inline uintptr_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); +static inline uintptr_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); - LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_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_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); - LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKChannelMonitor b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = ChannelMonitor_clone(&b_conv); + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr); + LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentPreimageAPIErrorZ_free(_res_conv); + C2Tuple_BlockHashChannelMonitorZ_free(_res_conv); } -static inline uintptr_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t j = 0; j < _res_constr.datalen; j++) { + int64_t _res_conv_35 = _res_vals[j]; + void* _res_conv_35_ptr = (void*)(((uintptr_t)_res_conv_35) & ~1); + CHECK_ACCESS(_res_conv_35_ptr); + LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr); + FREE((void*)_res_conv_35); + _res_constr.data[j] = _res_conv_35_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_BlockHashChannelMonitorZZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) { + LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o_constr; + o_constr.datalen = (*env)->GetArrayLength(env, o); + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements"); + else + o_constr.data = NULL; + int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); + for (size_t j = 0; j < o_constr.datalen; j++) { + int64_t o_conv_35 = o_vals[j]; + void* o_conv_35_ptr = (void*)(((uintptr_t)o_conv_35) & ~1); + CHECK_ACCESS(o_conv_35_ptr); + LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr); + o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o_conv_35) & ~1)); + o_constr.data[j] = o_conv_35_conv; + } + (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o_constr); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKIOError e_conv = LDKIOError_from_java(env, e); + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1); + jboolean ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1); - LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCounterpartyForwardingInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = CounterpartyForwardingInfo_clone(&o_conv); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); +static inline uintptr_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg); return (int64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1); + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_some(o); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none(JNIEnv *env, jclass clz) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); + LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr); FREE((void*)_res); - CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); + COption_u16Z_free(_res_conv); } -static inline uintptr_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; +static inline uintptr_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; + int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelCounterparty o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelCounterparty_clone(&o_conv); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); +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 (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_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*)(o & ~1); + jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_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 ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); + LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); + CResult_NoneAPIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); +static inline uintptr_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 (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_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*)(arg & ~1); + int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_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*)(orig & ~1); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelDetails o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelDetails_clone(&o_conv); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_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; + _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"); + 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 = (void*)(((uintptr_t)_res_conv_22) & ~1); + CHECK_ACCESS(_res_conv_22_ptr); + LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr); + FREE((void*)_res_conv_22); + _res_constr.data[w] = _res_conv_22_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_CResult_NoneAPIErrorZZ_free(_res_constr); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_APIErrorZ _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"); + 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 = (void*)(((uintptr_t)_res_conv_10) & ~1); + CHECK_ACCESS(_res_conv_10_ptr); + LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr); + FREE((void*)_res_conv_10); + _res_constr.data[k] = _res_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_APIErrorZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_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__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1); + jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); + LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); + CResult__u832APIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); +static inline uintptr_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); + int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKPhantomRouteHints o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PhantomRouteHints_clone(&o_conv); - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); - CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv); + CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); } -static inline uintptr_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(orig & ~1); - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_ChannelMonitorZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t q = 0; q < _res_constr.datalen; q++) { - int64_t _res_conv_16 = _res_vals[q]; - LDKChannelMonitor _res_conv_16_conv; - _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); - _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); - _res_constr.data[q] = _res_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_ChannelMonitorZ_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(); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKChannelManager b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = (b & 1) || (b == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - // WARNING: we need a move here but no clone is available for LDKChannelManager - LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); - *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +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*)(o & ~1); + jboolean ret_conv = CResult_NonePaymentSendFailureZ_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) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr); + LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_BlockHashChannelManagerZ_free(_res_conv); + CResult_NonePaymentSendFailureZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr); - // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv); +static inline uintptr_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); return (int64_t)ret_conv; } +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*)(arg & ~1); + int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_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*)(orig & ~1); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv); +static inline uintptr_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKThirtyTwoBytes b_ref; + CHECK((*env)->GetArrayLength(env, b) == 32); + (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref); + return ((int64_t)ret_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv); + C2Tuple_PaymentHashPaymentIdZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelConfig o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelConfig_clone(&o_conv); - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr); + o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelConfigDecodeErrorZ_free(_res_conv); + CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKOutPoint o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = OutPoint_clone(&o_conv); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKThirtyTwoBytes b_ref; + CHECK((*env)->GetArrayLength(env, b) == 32); + (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr); FREE((void*)_res); - CResult_OutPointDecodeErrorZ_free(_res_conv); + C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv); } -static inline uintptr_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); + o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKType o_conv = *(LDKType*)(o_ptr); - if (o_conv.free == LDKType_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKType_JCalls_cloned(&o_conv); - } - LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); - *ret_copy = COption_TypeZ_some(o_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); - *ret_copy = COption_TypeZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr); FREE((void*)_res); - COption_TypeZ_free(_res_conv); + CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv); } -static inline uintptr_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { - LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); - *ret_copy = COption_TypeZ_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; - int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; - LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); - *ret_copy = COption_TypeZ_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); - LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr); - o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uintptr_t)o) & ~1)); - LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); - *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv); + LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); + o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); - *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_COption_TypeZDecodeErrorZ_free(_res_conv); + CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); - *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); - LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); - *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_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_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); - *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref); + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr); - e_conv = PaymentError_clone((LDKPaymentError*)(((uintptr_t)e) & ~1)); - LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); - *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = CResult_PaymentSecretNoneZ_err(); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr); + LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr); FREE((void*)_res); - CResult_PaymentIdPaymentErrorZ_free(_res_conv); + CResult_PaymentSecretNoneZ_free(_res_conv); } -static inline uintptr_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); - *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg); +static inline uintptr_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) { + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = CResult_PaymentSecretNoneZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1); - LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); - *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1); + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) { - LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_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_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); - LDKParseError e_conv = *(LDKParseError*)(e_ptr); - e_conv = ParseError_clone((LDKParseError*)(((uintptr_t)e) & ~1)); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)(o & ~1); - jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr); + LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SiPrefixParseErrorZ_free(_res_conv); + CResult_PaymentSecretAPIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg); +static inline uintptr_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)(orig & ~1); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoice o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Invoice_clone(&o_conv); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_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_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); - LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); - e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)(((uintptr_t)e) & ~1)); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); + LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(o & ~1); - jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr); + LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv); + CResult_PaymentPreimageAPIErrorZ_free(_res_conv); } -static inline uintptr_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg); +static inline uintptr_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(orig & ~1); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1); + LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKSignedRawInvoice o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCounterpartyForwardingInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = SignedRawInvoice_clone(&o_conv); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv); + o_conv = CounterpartyForwardingInfo_clone(&o_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = (void*)(((uintptr_t)e) & ~1); - CHECK_ACCESS(e_ptr); - LDKParseError e_conv = *(LDKParseError*)(e_ptr); - e_conv = ParseError_clone((LDKParseError*)(((uintptr_t)e) & ~1)); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(o & ~1); - jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_SignedRawInvoiceParseErrorZ_free(_res_conv); + CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg); +static inline uintptr_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(orig & ~1); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(orig & ~1); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1); - int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b, int64_t c) { - LDKRawInvoice a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = RawInvoice_clone(&a_conv); - LDKThirtyTwoBytes b_ref; - CHECK((*env)->GetArrayLength(env, b) == 32); - (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); - LDKInvoiceSignature c_conv; - c_conv.inner = (void*)(c & (~1)); - c_conv.is_owned = (c & 1) || (c == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = InvoiceSignature_clone(&c_conv); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr); - FREE((void*)_res); - C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKPayeePubKey o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelCounterparty o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PayeePubKey_clone(&o_conv); - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv); + o_conv = ChannelCounterparty_clone(&o_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr); + LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_PayeePubKeyErrorZ_free(_res_conv); + CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) { - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1); - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_PrivateRouteZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_14 = _res_vals[o]; - LDKPrivateRoute _res_conv_14_conv; - _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); - _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_PrivateRouteZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKPositiveTimestamp o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelDetails o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PositiveTimestamp_clone(&o_conv); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); + o_conv = ChannelDetails_clone(&o_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKCreationError e_conv = LDKCreationError_from_java(env, e); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); + LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_PositiveTimestampCreationErrorZ_free(_res_conv); + CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKPhantomRouteHints o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PhantomRouteHints_clone(&o_conv); + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSemanticError e_conv = LDKSemanticError_from_java(env, e); - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr); + LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NoneSemanticErrorZ_free(_res_conv); + CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_clone(arg); +static inline uintptr_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1); - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInvoice o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Invoice_clone(&o_conv); - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)(orig & ~1); + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSemanticError e_conv = LDKSemanticError_from_java(env, e); - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_ChannelMonitorZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t q = 0; q < _res_constr.datalen; q++) { + int64_t _res_conv_16 = _res_vals[q]; + LDKChannelMonitor _res_conv_16_conv; + _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); + _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); + _res_constr.data[q] = _res_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_ChannelMonitorZ_free(_res_constr); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1); - jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKChannelManager b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + // WARNING: we need a move here but no clone is available for LDKChannelManager + LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); + *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr); + LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr); FREE((void*)_res); - CResult_InvoiceSemanticErrorZ_free(_res_conv); + C2Tuple_BlockHashChannelManagerZ_free(_res_conv); } -static inline uintptr_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr); + // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv); + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1); - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKDescription o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelConfig o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Description_clone(&o_conv); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); + o_conv = ChannelConfig_clone(&o_conv); + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKCreationError e_conv = LDKCreationError_from_java(env, e); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1); - jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); + LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_DescriptionCreationErrorZ_free(_res_conv); + CResult_ChannelConfigDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKPrivateRoute o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PrivateRoute_clone(&o_conv); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); + o_conv = OutPoint_clone(&o_conv); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKCreationError e_conv = LDKCreationError_from_java(env, e); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1); - jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); + LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_PrivateRouteCreationErrorZ_free(_res_conv); + CResult_OutPointDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); +static inline uintptr_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) { - LDKStr o_conv = java_to_owned_str(env, o); - LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); - *ret_conv = CResult_StringErrorZ_ok(o_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKType o_conv = *(LDKType*)(o_ptr); + if (o_conv.free == LDKType_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKType_JCalls_cloned(&o_conv); + } + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_some(o_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); - *ret_conv = CResult_StringErrorZ_err(e_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1); - jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); + LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr); FREE((void*)_res); - CResult_StringErrorZ_free(_res_conv); + COption_TypeZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelMonitorUpdate o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelMonitorUpdate_clone(&o_conv); - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); +static inline uintptr_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; + int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr); + o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uintptr_t)o) & ~1)); + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); + CResult_COption_TypeZDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); - o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)o) & ~1)); - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = COption_MonitorEventZ_some(o_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_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_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = COption_MonitorEventZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr); + e_conv = PaymentError_clone((LDKPaymentError*)(((uintptr_t)e) & ~1)); + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); + LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr); FREE((void*)_res); - COption_MonitorEventZ_free(_res_conv); + CResult_PaymentIdPaymentErrorZ_free(_res_conv); } -static inline uintptr_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = COption_MonitorEventZ_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; - int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = COption_MonitorEventZ_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1); + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); - o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uintptr_t)o) & ~1)); - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) { + LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKParseError e_conv = *(LDKParseError*)(e_ptr); + e_conv = ParseError_clone((LDKParseError*)(((uintptr_t)e) & ~1)); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)(o & ~1); + jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); + LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv); + CResult_SiPrefixParseErrorZ_free(_res_conv); } -static inline uintptr_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)(orig & ~1); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKHTLCUpdate o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = HTLCUpdate_clone(&o_conv); - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); + o_conv = Invoice_clone(&o_conv); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); + e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)(((uintptr_t)e) & ~1)); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(o & ~1); + jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr); + LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_HTLCUpdateDecodeErrorZ_free(_res_conv); + CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv); } -static inline uintptr_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)(orig & ~1); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) { - LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); - *ret_conv = C2Tuple_OutPointScriptZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKSignedRawInvoice o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = SignedRawInvoice_clone(&o_conv); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1); - LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); - *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKParseError e_conv = *(LDKParseError*)(e_ptr); + e_conv = ParseError_clone((LDKParseError*)(((uintptr_t)e) & ~1)); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - 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_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); - *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(o & ~1); + jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr); + LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_OutPointScriptZ_free(_res_conv); + CResult_SignedRawInvoiceParseErrorZ_free(_res_conv); } -static inline uintptr_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) { - LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); - *ret_conv = C2Tuple_u32ScriptZ_clone(arg); +static inline uintptr_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)(orig & ~1); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +static inline uintptr_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg); return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1); + int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); - LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); - *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv); return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_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_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); - *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b, int64_t c) { + LDKRawInvoice a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = RawInvoice_clone(&a_conv); + LDKThirtyTwoBytes b_ref; + CHECK((*env)->GetArrayLength(env, b) == 32); + (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data); + LDKInvoiceSignature c_conv; + c_conv.inner = (void*)(c & (~1)); + c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); + c_conv = InvoiceSignature_clone(&c_conv); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv); return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_u32ScriptZ_free(_res_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_u32ScriptZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t v = 0; v < _res_constr.datalen; v++) { - int64_t _res_conv_21 = _res_vals[v]; - void* _res_conv_21_ptr = (void*)(((uintptr_t)_res_conv_21) & ~1); - CHECK_ACCESS(_res_conv_21_ptr); - LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr); - FREE((void*)_res_conv_21); - _res_constr.data[v] = _res_conv_21_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_u32ScriptZZ_free(_res_constr); + C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv); } -static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKPayeePubKey o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PayeePubKey_clone(&o_conv); + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKCVec_C2Tuple_u32ScriptZZ b_constr; - b_constr.datalen = (*env)->GetArrayLength(env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); - else - b_constr.data = NULL; - int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); - for (size_t v = 0; v < b_constr.datalen; v++) { - int64_t b_conv_21 = b_vals[v]; - void* b_conv_21_ptr = (void*)(((uintptr_t)b_conv_21) & ~1); - CHECK_ACCESS(b_conv_21_ptr); - LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr); - b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uintptr_t)b_conv_21) & ~1)); - b_constr.data[v] = b_conv_21_conv; - } - (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr); + LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv); + CResult_PayeePubKeyErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr; +static inline uintptr_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1); + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_PrivateRouteZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); for (size_t o = 0; o < _res_constr.datalen; o++) { - int64_t _res_conv_40 = _res_vals[o]; - void* _res_conv_40_ptr = (void*)(((uintptr_t)_res_conv_40) & ~1); - CHECK_ACCESS(_res_conv_40_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr); - FREE((void*)_res_conv_40); - _res_constr.data[o] = _res_conv_40_conv; + int64_t _res_conv_14 = _res_vals[o]; + LDKPrivateRoute _res_conv_14_conv; + _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); + _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr); + CVec_PrivateRouteZ_free(_res_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_EventZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int64_t _res_conv_7 = _res_vals[h]; - void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); - CHECK_ACCESS(_res_conv_7_ptr); - LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr); - FREE((void*)_res_conv_7); - _res_constr.data[h] = _res_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_EventZ_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKPositiveTimestamp o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PositiveTimestamp_clone(&o_conv); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { - LDKCVec_TransactionZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ 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); - LDKTransaction _res_conv_8_ref; - _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8); - _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data); - _res_conv_8_ref.data_is_owned = true; - _res_constr.data[i] = _res_conv_8_ref; - } - CVec_TransactionZ_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKCreationError e_conv = LDKCreationError_from_java(env, e); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv); + return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { - LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); - *ret_conv = C2Tuple_u32TxOutZ_clone(arg); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_PositiveTimestampCreationErrorZ_free(_res_conv); +} + +static inline uintptr_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); - LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); - *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) { - void* b_ptr = (void*)(((uintptr_t)b) & ~1); - CHECK_ACCESS(b_ptr); - LDKTxOut b_conv = *(LDKTxOut*)(b_ptr); - b_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)b) & ~1)); - LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); - *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_ok(); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKSemanticError e_conv = LDKSemanticError_from_java(env, e); + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr); + LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_u32TxOutZ_free(_res_conv); + CResult_NoneSemanticErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_u32TxOutZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ 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]; - void* _res_conv_20_ptr = (void*)(((uintptr_t)_res_conv_20) & ~1); - CHECK_ACCESS(_res_conv_20_ptr); - LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr); - FREE((void*)_res_conv_20); - _res_constr.data[u] = _res_conv_20_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_u32TxOutZZ_free(_res_constr); +static inline uintptr_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; } -static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1); + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoice o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Invoice_clone(&o_conv); + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKSemanticError e_conv = LDKSemanticError_from_java(env, e); + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 32); - (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); - LDKCVec_C2Tuple_u32TxOutZZ b_constr; - b_constr.datalen = (*env)->GetArrayLength(env, b); - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); - else - b_constr.data = NULL; - int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); - for (size_t u = 0; u < b_constr.datalen; u++) { - int64_t b_conv_20 = b_vals[u]; - void* b_conv_20_ptr = (void*)(((uintptr_t)b_conv_20) & ~1); - CHECK_ACCESS(b_conv_20_ptr); - LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr); - b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uintptr_t)b_conv_20) & ~1)); - b_constr.data[u] = b_conv_20_conv; - } - (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1); + jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr); + LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv); + CResult_InvoiceSemanticErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ 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_39 = _res_vals[n]; - void* _res_conv_39_ptr = (void*)(((uintptr_t)_res_conv_39) & ~1); - CHECK_ACCESS(_res_conv_39_ptr); - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr); - FREE((void*)_res_conv_39); - _res_constr.data[n] = _res_conv_39_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr); +static inline uintptr_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv); + return ret_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); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t j = 0; j < _res_constr.datalen; j++) { - int64_t _res_conv_9 = _res_vals[j]; - void* _res_conv_9_ptr = (void*)(((uintptr_t)_res_conv_9) & ~1); - CHECK_ACCESS(_res_conv_9_ptr); - LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr); - FREE((void*)_res_conv_9); - _res_constr.data[j] = _res_conv_9_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_BalanceZ_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1); + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr); - o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o) & ~1)); - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKDescription o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Description_clone(&o_conv); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKCreationError e_conv = LDKCreationError_from_java(env, e); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1); + jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr); + LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); + CResult_DescriptionCreationErrorZ_free(_res_conv); } -static inline uintptr_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = CResult_NoneLightningErrorZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKPrivateRoute o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PrivateRoute_clone(&o_conv); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKLightningError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = LightningError_clone(&e_conv); - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKCreationError e_conv = LDKCreationError_from_java(env, e); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1); + jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr); + LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NoneLightningErrorZ_free(_res_conv); + CResult_PrivateRouteCreationErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = CResult_NoneLightningErrorZ_clone(arg); +static inline uintptr_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); - LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); - *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { - LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); - *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); - int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) { + LDKStr o_conv = java_to_owned_str(env, o); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_ok(o_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); - LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); - *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv); - return ((int64_t)ret_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_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); - void* b_ptr = (void*)(((uintptr_t)b) & ~1); - CHECK_ACCESS(b_ptr); - LDKType b_conv = *(LDKType*)(b_ptr); - if (b_conv.free == LDKType_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKType_JCalls_cloned(&b_conv); - } - LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); - *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv); - return ((int64_t)ret_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1); + jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr); + LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); FREE((void*)_res); - C2Tuple_PublicKeyTypeZ_free(_res_conv); + CResult_StringErrorZ_free(_res_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t z = 0; z < _res_constr.datalen; z++) { - int64_t _res_conv_25 = _res_vals[z]; - void* _res_conv_25_ptr = (void*)(((uintptr_t)_res_conv_25) & ~1); - CHECK_ACCESS(_res_conv_25_ptr); - LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr); - FREE((void*)_res_conv_25); - _res_constr.data[z] = _res_conv_25_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); +static inline uintptr_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) { + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_clone(arg); + return (int64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) { - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_ok(o); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)(orig & ~1); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKLightningError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelMonitorUpdate o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelMonitorUpdate_clone(&o_conv); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = LightningError_clone(&e_conv); - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_err(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1); - jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_boolLightningErrorZ_free(_res_conv); + CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); - LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); - *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -static inline uintptr_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); - *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); - return ((int64_t)ret_conv); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); - int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); - *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) { - LDKChannelAnnouncement a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = ChannelAnnouncement_clone(&a_conv); - LDKChannelUpdate b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = (b & 1) || (b == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = ChannelUpdate_clone(&b_conv); - LDKChannelUpdate c_conv; - c_conv.inner = (void*)(c & (~1)); - c_conv.is_owned = (c & 1) || (c == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); - c_conv = ChannelUpdate_clone(&c_conv); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); - *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); - CHECK_ACCESS(_res_ptr); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr); - FREE((void*)_res); - C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t h = 0; h < _res_constr.datalen; h++) { - int64_t _res_conv_59 = _res_vals[h]; - void* _res_conv_59_ptr = (void*)(((uintptr_t)_res_conv_59) & ~1); - CHECK_ACCESS(_res_conv_59_ptr); - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr); - FREE((void*)_res_conv_59); - _res_constr.data[h] = _res_conv_59_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_NodeAnnouncementZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t s = 0; s < _res_constr.datalen; s++) { - int64_t _res_conv_18 = _res_vals[s]; - LDKNodeAnnouncement _res_conv_18_conv; - _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1)); - _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv); - _res_constr.data[s] = _res_conv_18_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_NodeAnnouncementZ_free(_res_constr); -} - -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_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); - LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); - o_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o) & ~1)); - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_some(o_conv); + LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); + o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)o) & ~1)); + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_some(o_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_none(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_none(); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr); + LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); FREE((void*)_res); - COption_NetAddressZ_free(_res_conv); + COption_MonitorEventZ_free(_res_conv); } -static inline uintptr_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) { - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_clone(arg); +static inline uintptr_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(arg); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)arg; - int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; + int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)orig; - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(orig_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(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); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); + o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uintptr_t)o) & ~1)); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKPeerHandleError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = PeerHandleError_clone(&e_conv); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1); - jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); + LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); + CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); +static inline uintptr_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_ok(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKHTLCUpdate o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = HTLCUpdate_clone(&o_conv); + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKPeerHandleError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = PeerHandleError_clone(&e_conv); - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); + LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NonePeerHandleErrorZ_free(_res_conv); + CResult_HTLCUpdateDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); +static inline uintptr_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) { - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_ok(o); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKPeerHandleError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = PeerHandleError_clone(&e_conv); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1); + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1); - jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + 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_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); + LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr); FREE((void*)_res); - CResult_boolPeerHandleErrorZ_free(_res_conv); + C2Tuple_OutPointScriptZ_free(_res_conv); } -static inline uintptr_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_clone(arg); + return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeId o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeId_clone(&o_conv); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); + LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_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_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr); FREE((void*)_res); - CResult_NodeIdDecodeErrorZ_free(_res_conv); + C2Tuple_u32ScriptZ_free(_res_conv); } -static inline uintptr_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_u32ScriptZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t v = 0; v < _res_constr.datalen; v++) { + int64_t _res_conv_21 = _res_vals[v]; + void* _res_conv_21_ptr = (void*)(((uintptr_t)_res_conv_21) & ~1); + CHECK_ACCESS(_res_conv_21_ptr); + LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr); + FREE((void*)_res_conv_21); + _res_constr.data[v] = _res_conv_21_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_u32ScriptZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); - LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); - *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg); + return ((int64_t)ret_conv); } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); - o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uintptr_t)o) & ~1)); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1); + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKCVec_C2Tuple_u32ScriptZZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t v = 0; v < b_constr.datalen; v++) { + int64_t b_conv_21 = b_vals[v]; + void* b_conv_21_ptr = (void*)(((uintptr_t)b_conv_21) & ~1); + CHECK_ACCESS(b_conv_21_ptr); + LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr); + b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uintptr_t)b_conv_21) & ~1)); + b_constr.data[v] = b_conv_21_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr); FREE((void*)_res); - CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv); + C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv); } -static inline uintptr_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t o = 0; o < _res_constr.datalen; o++) { + int64_t _res_conv_40 = _res_vals[o]; + void* _res_conv_40_ptr = (void*)(((uintptr_t)_res_conv_40) & ~1); + CHECK_ACCESS(_res_conv_40_ptr); + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr); + FREE((void*)_res_conv_40); + _res_constr.data[o] = _res_conv_40_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); - LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); - *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_EventZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t h = 0; h < _res_constr.datalen; h++) { + int64_t _res_conv_7 = _res_vals[h]; + void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); + CHECK_ACCESS(_res_conv_7_ptr); + LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr); + FREE((void*)_res_conv_7); + _res_constr.data[h] = _res_conv_7_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_EventZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = (void*)(((uintptr_t)o) & ~1); - CHECK_ACCESS(o_ptr); - LDKAccess o_conv = *(LDKAccess*)(o_ptr); - if (o_conv.free == LDKAccess_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKAccess_JCalls_cloned(&o_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_TransactionZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ 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); + LDKTransaction _res_conv_8_ref; + _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8); + _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data); + _res_conv_8_ref.data_is_owned = true; + _res_constr.data[i] = _res_conv_8_ref; } - LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); - *ret_copy = COption_AccessZ_some(o_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; + CVec_TransactionZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); - *ret_copy = COption_AccessZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) { + void* b_ptr = (void*)(((uintptr_t)b) & ~1); + CHECK_ACCESS(b_ptr); + LDKTxOut b_conv = *(LDKTxOut*)(b_ptr); + b_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)b) & ~1)); + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr); + LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr); FREE((void*)_res); - COption_AccessZ_free(_res_conv); + C2Tuple_u32TxOutZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelUpdateInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelUpdateInfo_clone(&o_conv); - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_u32TxOutZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ 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]; + void* _res_conv_20_ptr = (void*)(((uintptr_t)_res_conv_20) & ~1); + CHECK_ACCESS(_res_conv_20_ptr); + LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr); + FREE((void*)_res_conv_20); + _res_constr.data[u] = _res_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_u32TxOutZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); + return ((int64_t)ret_conv); } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv); + return ((int64_t)ret_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) { + LDKThirtyTwoBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 32); + (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data); + LDKCVec_C2Tuple_u32TxOutZZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t u = 0; u < b_constr.datalen; u++) { + int64_t b_conv_20 = b_vals[u]; + void* b_conv_20_ptr = (void*)(((uintptr_t)b_conv_20) & ~1); + CHECK_ACCESS(b_conv_20_ptr); + LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr); + b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uintptr_t)b_conv_20) & ~1)); + b_constr.data[u] = b_conv_20_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr); + return ((int64_t)ret_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv); + C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ 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_39 = _res_vals[n]; + void* _res_conv_39_ptr = (void*)(((uintptr_t)_res_conv_39) & ~1); + CHECK_ACCESS(_res_conv_39_ptr); + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr); + FREE((void*)_res_conv_39); + _res_constr.data[n] = _res_conv_39_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_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); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t j = 0; j < _res_constr.datalen; j++) { + int64_t _res_conv_9 = _res_vals[j]; + void* _res_conv_9_ptr = (void*)(((uintptr_t)_res_conv_9) & ~1); + CHECK_ACCESS(_res_conv_9_ptr); + LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr); + FREE((void*)_res_conv_9); + _res_constr.data[j] = _res_conv_9_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_BalanceZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKChannelInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelInfo_clone(&o_conv); - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr); + o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o) & ~1)); + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr); + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_ChannelInfoDecodeErrorZ_free(_res_conv); + CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); - *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKRoutingFees o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = RoutingFees_clone(&o_conv); - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +static inline uintptr_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); + return ((int64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); + int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv); + return ((int64_t)ret_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_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); + void* b_ptr = (void*)(((uintptr_t)b) & ~1); + CHECK_ACCESS(b_ptr); + LDKType b_conv = *(LDKType*)(b_ptr); + if (b_conv.free == LDKType_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKType_JCalls_cloned(&b_conv); + } + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv); + return ((int64_t)ret_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr); + LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr); FREE((void*)_res); - CResult_RoutingFeesDecodeErrorZ_free(_res_conv); -} - -static inline uintptr_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); - LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); - *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; + C2Tuple_PublicKeyTypeZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeAnnouncementInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeAnnouncementInfo_clone(&o_conv); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t z = 0; z < _res_constr.datalen; z++) { + int64_t _res_conv_25 = _res_vals[z]; + void* _res_conv_25_ptr = (void*)(((uintptr_t)_res_conv_25) & ~1); + CHECK_ACCESS(_res_conv_25_ptr); + LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr); + FREE((void*)_res_conv_25); + _res_constr.data[z] = _res_conv_25_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; - e_conv.inner = (void*)(e & (~1)); - e_conv.is_owned = (e & 1) || (e == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uintptr_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); + o_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o) & ~1)); + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_some(o_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr); + LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr); FREE((void*)_res); - CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); + COption_NetAddressZ_free(_res_conv); } -static inline uintptr_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); - return (int64_t)ret_conv; +static inline uintptr_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) { + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)arg; + int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); - *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_u64Z _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - _res_constr.data = NULL; - int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); - for (size_t g = 0; g < _res_constr.datalen; g++) { - int64_t _res_conv_6 = _res_vals[g]; - _res_constr.data[g] = _res_conv_6; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_u64Z_free(_res_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)orig; + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNodeInfo o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NodeInfo_clone(&o_conv); - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(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); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); + e_conv = PeerHandleError_clone(&e_conv); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1); + jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr); + LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NodeInfoDecodeErrorZ_free(_res_conv); + CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); - LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); - *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKNetworkGraph o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = (o & 1) || (o == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = NetworkGraph_clone(&o_conv); - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_ok(); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKDecodeError e_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = DecodeError_clone(&e_conv); - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); + e_conv = PeerHandleError_clone(&e_conv); + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1); + jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr); + LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_NetworkGraphDecodeErrorZ_free(_res_conv); + CResult_NonePeerHandleErrorZ_free(_res_conv); } -static inline uintptr_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1); - LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some(JNIEnv *env, jclass clz, int64_tArray o) { - LDKCVec_NetAddressZ o_constr; - o_constr.datalen = (*env)->GetArrayLength(env, o); - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); - else - o_constr.data = NULL; - int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL); - for (size_t m = 0; m < o_constr.datalen; m++) { - int64_t o_conv_12 = o_vals[m]; - void* o_conv_12_ptr = (void*)(((uintptr_t)o_conv_12) & ~1); - CHECK_ACCESS(o_conv_12_ptr); - LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr); - o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o_conv_12) & ~1)); - o_constr.data[m] = o_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, o, o_vals, 0); - LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); - *ret_copy = COption_CVec_NetAddressZZ_some(o_constr); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_ok(o); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); - *ret_copy = COption_CVec_NetAddressZZ_none(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKPeerHandleError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = PeerHandleError_clone(&e_conv); + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1); + jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr); + LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); - COption_CVec_NetAddressZZ_free(_res_conv); + CResult_boolPeerHandleErrorZ_free(_res_conv); } -static inline uintptr_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { - LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); - *ret_copy = COption_CVec_NetAddressZZ_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; - int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; - LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); - *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1ok(JNIEnv *env, jclass clz, int32_t o) { + LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ"); + *ret_conv = CResult_u32GraphSyncErrorZ_ok(o); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = (void*)(((uintptr_t)e) & ~1); + CHECK_ACCESS(e_ptr); + LDKGraphSyncError e_conv = *(LDKGraphSyncError*)(e_ptr); + e_conv = GraphSyncError_clone((LDKGraphSyncError*)(((uintptr_t)e) & ~1)); + LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ"); + *ret_conv = CResult_u32GraphSyncErrorZ_err(e_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_u32GraphSyncErrorZ* o_conv = (LDKCResult_u32GraphSyncErrorZ*)(o & ~1); + jboolean ret_conv = CResult_u32GraphSyncErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_u32GraphSyncErrorZ _res_conv = *(LDKCResult_u32GraphSyncErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_u32GraphSyncErrorZ_free(_res_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { @@ -21577,58 +22038,58 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKFundingLocked o_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKChannelReady o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = FundingLocked_clone(&o_conv); - LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv); + o_conv = ChannelReady_clone(&o_conv); + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); - LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv); + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv); return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_FundingLockedDecodeErrorZ* o_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(o & ~1); - jboolean ret_conv = CResult_FundingLockedDecodeErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(o & ~1); + jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); - LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr); FREE((void*)_res); - CResult_FundingLockedDecodeErrorZ_free(_res_conv); + CResult_ChannelReadyDecodeErrorZ_free(_res_conv); } -static inline uintptr_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg); +static inline uintptr_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); - int64_t ret_conv = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(arg & ~1); + int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1); - LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)(orig & ~1); + LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv); return (int64_t)ret_conv; } @@ -23160,6 +23621,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous return ret_ref; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)obj; + LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); + *ret_conv = PaymentPurpose_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); @@ -23295,21 +23775,38 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, j return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) { LDKThirtyTwoBytes temporary_channel_id_ref; CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); LDKCVec_u8Z output_script_ref; output_script_ref.datalen = (*env)->GetArrayLength(env, output_script); output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, channel_value_satoshis, output_script_ref, user_channel_id); + *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* purpose_ptr = (void*)(((uintptr_t)purpose) & ~1); + CHECK_ACCESS(purpose_ptr); + LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uintptr_t)purpose) & ~1)); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amt, int64_t purpose) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) { LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -23318,7 +23815,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JN LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uintptr_t)purpose) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_received(payment_hash_ref, amt, purpose_conv); + *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -23343,6 +23840,49 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_tArray path) { + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCVec_RouteHopZ path_constr; + path_constr.datalen = (*env)->GetArrayLength(env, path); + if (path_constr.datalen > 0) + path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); + else + path_constr.data = NULL; + int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); + for (size_t k = 0; k < path_constr.datalen; k++) { + int64_t path_conv_10 = path_vals[k]; + LDKRouteHop path_conv_10_conv; + path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); + path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); + path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); + path_constr.data[k] = path_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, jboolean rejected_by_dest, int64_t network_update, jboolean all_paths_failed, int64_tArray path, int64_t short_channel_id, int64_t retry) { LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); @@ -23386,19 +23926,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) { LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); @@ -23429,13 +23956,19 @@ 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 fee_earned_msat, jboolean claim_from_onchain_tx) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(JNIEnv *env, jclass clz, int8_tArray prev_channel_id, int8_tArray next_channel_id, int64_t fee_earned_msat, jboolean claim_from_onchain_tx) { + LDKThirtyTwoBytes prev_channel_id_ref; + CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32); + (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data); + LDKThirtyTwoBytes next_channel_id_ref; + CHECK((*env)->GetArrayLength(env, next_channel_id) == 32); + (*env)->GetByteArrayRegion(env, next_channel_id, 0, 32, next_channel_id_ref.data); void* fee_earned_msat_ptr = (void*)(((uintptr_t)fee_earned_msat) & ~1); CHECK_ACCESS(fee_earned_msat_ptr); LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr); fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)fee_earned_msat) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_forwarded(fee_earned_msat_conv, claim_from_onchain_tx); + *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -23469,36 +24002,6 @@ 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_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_tArray path) { - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - LDKThirtyTwoBytes payment_hash_ref; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKCVec_RouteHopZ path_constr; - path_constr.datalen = (*env)->GetArrayLength(env, path); - if (path_constr.datalen > 0) - path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); - else - path_constr.data = NULL; - int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL); - for (size_t k = 0; k < path_constr.datalen; k++) { - int64_t path_conv_10 = path_vals[k]; - LDKRouteHop path_conv_10_conv; - path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); - path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); - path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); - path_constr.data[k] = path_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, path, path_vals, 0); - LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1open_1channel_1request(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_t channel_type) { LDKThirtyTwoBytes temporary_channel_id_ref; CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); @@ -23625,17 +24128,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1locked(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) { LDKPublicKey node_id_ref; CHECK((*env)->GetArrayLength(env, node_id) == 33); (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - LDKFundingLocked msg_conv; + LDKChannelReady msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = FundingLocked_clone(&msg_conv); + msg_conv = ChannelReady_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); - *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv); + *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -23860,335 +24363,2113 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1gos return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); - FREE((void*)this_ptr); - MessageSendEventsProvider_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); + FREE((void*)this_ptr); + MessageSendEventsProvider_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); + FREE((void*)this_ptr); + EventsProvider_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); + FREE((void*)this_ptr); + EventHandler_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); + FREE((void*)this_ptr); + APIError_free(this_ptr_conv); +} + +static inline uintptr_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)arg; + int64_t ret_conv = APIError_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAPIError* orig_conv = (LDKAPIError*)orig; + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_apimisuse_error(err_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_route_error(err_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) { + LDKStr err_conv = java_to_owned_str(env, err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_channel_unavailable(err_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed(JNIEnv *env, jclass clz) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_monitor_update_failed(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script(JNIEnv *env, jclass clz, int64_t script) { + LDKShutdownScript script_conv; + script_conv.inner = (void*)(script & (~1)); + script_conv.is_owned = (script & 1) || (script == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); + script_conv = ShutdownScript_clone(&script_conv); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_incompatible_shutdown_script(script_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBigSize this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BigSize_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBigSize this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = BigSize_get_a(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKBigSize this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + BigSize_set_a(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1new(JNIEnv *env, jclass clz, int64_t a_arg) { + LDKBigSize ret_var = BigSize_new(a_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) { + LDKu8slice msg_ref; + msg_ref.datalen = (*env)->GetArrayLength(env, msg); + msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); + unsigned char sk_arr[32]; + CHECK((*env)->GetArrayLength(env, sk) == 32); + (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr); + unsigned char (*sk_ref)[32] = &sk_arr; + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = sign(msg_ref, sk_ref); + (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) { + LDKu8slice msg_ref; + msg_ref.datalen = (*env)->GetArrayLength(env, msg); + msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); + LDKStr sig_conv = java_to_owned_str(env, sig); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = recover_pk(msg_ref, sig_conv); + (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig, int8_tArray pk) { + LDKu8slice msg_ref; + msg_ref.datalen = (*env)->GetArrayLength(env, msg); + msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); + LDKStr sig_conv = java_to_owned_str(env, sig); + LDKPublicKey pk_ref; + CHECK((*env)->GetArrayLength(env, pk) == 33); + (*env)->GetByteArrayRegion(env, pk, 0, 33, pk_ref.compressed_form); + jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); + (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) { + LDKu8slice hrp_bytes_ref; + hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); + hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); + LDKCVec_u5Z data_without_signature_constr; + data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature); + if (data_without_signature_constr.datalen > 0) + data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); + else + data_without_signature_constr.data = NULL; + int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL); + for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { + int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; + + data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 }; + } + (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0); + LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); + FREE((void*)this_ptr); + Persister_free(this_ptr_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKLevel* orig_conv = (LDKLevel*)(orig & ~1); + jclass ret_conv = LDKLevel_to_java(env, Level_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_gossip()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_trace()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_debug()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_info()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_warn()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_error()); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKLevel* a_conv = (LDKLevel*)(a & ~1); + LDKLevel* b_conv = (LDKLevel*)(b & ~1); + jboolean ret_conv = Level_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Level_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKLevel* o_conv = (LDKLevel*)(o & ~1); + int64_t ret_conv = Level_hash(o_conv); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKLevel_to_java(env, Level_max()); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRecord this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Record_free(this_obj_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv)); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKLevel val_conv = LDKLevel_from_java(env, val); + Record_set_level(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_args(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_args(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_module_path(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_module_path(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_file(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_file(&this_ptr_conv, val_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = Record_get_line(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + Record_set_line(&this_ptr_conv, val); +} + +static inline uintptr_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRecord arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = Record_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecord orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKRecord ret_var = Record_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); + FREE((void*)this_ptr); + Logger_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelHandshakeConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelHandshakeConfig_free(this_obj_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1max_1inbound_1htlc_1value_1in_1flight_1percent_1of_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1max_1inbound_1htlc_1value_1in_1flight_1percent_1of_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, int8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, jboolean negotiate_scid_privacy_arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, max_inbound_htlc_value_in_flight_percent_of_channel_arg, negotiate_scid_privacy_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelHandshakeConfig orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelHandshakeLimits this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelHandshakeLimits_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv *env, jclass clz, int64_t min_funding_satoshis_arg, int64_t max_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean trust_own_funding_0conf_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeLimits arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelHandshakeLimits orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelConfig_free(this_obj_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelConfig_get_announced_channel(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_announced_channel(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { + LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelConfig orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) { + LDKChannelConfig ret_var = ChannelConfig_default(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelConfig obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelConfig_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_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = ChannelConfig_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUserConfig this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UserConfig_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelHandshakeConfig val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelHandshakeConfig_clone(&val_conv); + UserConfig_set_own_channel_config(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelHandshakeLimits val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelHandshakeLimits_clone(&val_conv); + UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelConfig val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelConfig_clone(&val_conv); + UserConfig_set_channel_options(&this_ptr_conv, val_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UserConfig_set_accept_inbound_channels(&this_ptr_conv, val); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg) { + LDKChannelHandshakeConfig own_channel_config_arg_conv; + own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); + own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv); + own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv); + LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv; + peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1)); + peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv); + peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv); + LDKChannelConfig channel_options_arg_conv; + channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); + channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); + channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); + LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUserConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = UserConfig_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUserConfig orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKUserConfig ret_var = UserConfig_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) { + LDKUserConfig ret_var = UserConfig_default(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBestBlock this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BestBlock_free(this_obj_conv); +} + +static inline uintptr_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBestBlock arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = BestBlock_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBestBlock orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKBestBlock ret_var = BestBlock_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) { + LDKNetwork network_conv = LDKNetwork_from_java(env, network); + LDKBestBlock ret_var = BestBlock_from_genesis(network_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) { + LDKThirtyTwoBytes block_hash_ref; + CHECK((*env)->GetArrayLength(env, block_hash) == 32); + (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data); + LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBestBlock this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data); + return ret_arr; +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKBestBlock this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int32_t ret_conv = BestBlock_height(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAccessError* orig_conv = (LDKAccessError*)(orig & ~1); + jclass ret_conv = LDKAccessError_to_java(env, AccessError_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1chain(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_chain()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1tx(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_tx()); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr); + FREE((void*)this_ptr); + Access_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); + FREE((void*)this_ptr); + Listen_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); + FREE((void*)this_ptr); + Confirm_free(this_ptr_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)(orig & ~1); + jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_temporary_failure()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_permanent_failure()); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); + FREE((void*)this_ptr); + Watch_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); + FREE((void*)this_ptr); + Filter_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKWatchedOutput this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + WatchedOutput_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + WatchedOutput_set_block_hash(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&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); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv *env, jclass clz, int8_tArray block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) { + LDKThirtyTwoBytes block_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, block_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, block_hash_arg, 0, 32, block_hash_arg_ref.data); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); + outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKCVec_u8Z script_pubkey_arg_ref; + script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg); + script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data); + LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKWatchedOutput arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKWatchedOutput orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKWatchedOutput o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + int64_t ret_conv = WatchedOutput_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); + FREE((void*)this_ptr); + BroadcasterInterface_free(this_ptr_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)(orig & ~1); + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority()); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)(a & ~1); + LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)(b & ~1); + jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); + FREE((void*)this_ptr); + FeeEstimator_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMonitorUpdateId this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MonitorUpdateId_free(this_obj_conv); +} + +static inline uintptr_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { + LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorUpdateId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMonitorUpdateId orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKMonitorUpdateId o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + int64_t ret_conv = MonitorUpdateId_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKMonitorUpdateId a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKMonitorUpdateId b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); + FREE((void*)this_ptr); + Persist_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKLockedChannelMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + LockedChannelMonitor_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChainMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChainMonitor_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *env, jclass clz, int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) { + void* chain_source_ptr = (void*)(((uintptr_t)chain_source) & ~1); + CHECK_ACCESS(chain_source_ptr); + LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (chain_source_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&chain_source_conv.some); + } + } + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* feeest_ptr = (void*)(((uintptr_t)feeest) & ~1); + CHECK_ACCESS(feeest_ptr); + LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); + if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&feeest_conv); + } + void* persister_ptr = (void*)(((uintptr_t)persister) & ~1); + CHECK_ACCESS(persister_ptr); + LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); + if (persister_conv.free == LDKPersist_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKPersist_JCalls_cloned(&persister_conv); + } + LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray ignored_channels) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_ChannelDetailsZ ignored_channels_constr; + ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels); + if (ignored_channels_constr.datalen > 0) + ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + ignored_channels_constr.data = NULL; + int64_t* ignored_channels_vals = (*env)->GetLongArrayElements (env, ignored_channels, NULL); + for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { + int64_t ignored_channels_conv_16 = ignored_channels_vals[q]; + LDKChannelDetails ignored_channels_conv_16_conv; + ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1)); + ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); + ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); + ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0); + LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); + 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 j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + int64_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; + ret_arr_ptr[j] = ret_conv_9_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_ChainMonitor_1get_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = (void*)(funding_txo & (~1)); + funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&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 k = 0; k < ret_var.datalen; k++) { + LDKOutPoint ret_conv_10_var = ret_var.data[k]; + int64_t ret_conv_10_ref = 0; + CHECK((((uintptr_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); + ret_conv_10_ref = (uintptr_t)ret_conv_10_var.inner; + if (ret_conv_10_var.is_owned) { + ret_conv_10_ref |= 1; + } + ret_arr_ptr[k] = ret_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = (void*)(funding_txo & (~1)); + funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKMonitorUpdateId completed_update_id_conv; + completed_update_id_conv.inner = (void*)(completed_update_id & (~1)); + completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); + completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); + *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelMonitorUpdate this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelMonitorUpdate_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelMonitorUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelMonitorUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); +} + +static inline uintptr_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitorUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelMonitorUpdate orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); - FREE((void*)this_ptr); - EventsProvider_free(this_ptr_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelMonitorUpdate obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); - FREE((void*)this_ptr); - EventHandler_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_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_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = ChannelMonitorUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); + LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); FREE((void*)this_ptr); - APIError_free(this_ptr_conv); + MonitorEvent_free(this_ptr_conv); } -static inline uintptr_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(arg); +static inline uintptr_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAPIError* arg_conv = (LDKAPIError*)arg; - int64_t ret_conv = APIError_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; + int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAPIError* orig_conv = (LDKAPIError*)orig; - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_apimisuse_error(err_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(orig_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_route_error(err_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) { + LDKHTLCUpdate a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = HTLCUpdate_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_htlcevent(a_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) { - LDKStr err_conv = java_to_owned_str(env, err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_channel_unavailable(err_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz, int64_t a) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed(JNIEnv *env, jclass clz) { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_monitor_update_failed(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) { + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = (void*)(funding_txo & (~1)); + funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script(JNIEnv *env, jclass clz, int64_t script) { - LDKShutdownScript script_conv; - script_conv.inner = (void*)(script & (~1)); - script_conv.is_owned = (script & 1) || (script == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); - script_conv = ShutdownScript_clone(&script_conv); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_incompatible_shutdown_script(script_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_update_failed(a_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) { - LDKu8slice msg_ref; - msg_ref.datalen = (*env)->GetArrayLength(env, msg); - msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); - unsigned char sk_arr[32]; - CHECK((*env)->GetArrayLength(env, sk) == 32); - (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr); - unsigned char (*sk_ref)[32] = &sk_arr; - LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); - *ret_conv = sign(msg_ref, sk_ref); - (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) { - LDKu8slice msg_ref; - msg_ref.datalen = (*env)->GetArrayLength(env, msg); - msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); - LDKStr sig_conv = java_to_owned_str(env, sig); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = recover_pk(msg_ref, sig_conv); - (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig, int8_tArray pk) { - LDKu8slice msg_ref; - msg_ref.datalen = (*env)->GetArrayLength(env, msg); - msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL); - LDKStr sig_conv = java_to_owned_str(env, sig); - LDKPublicKey pk_ref; - CHECK((*env)->GetArrayLength(env, pk) == 33); - (*env)->GetByteArrayRegion(env, pk, 0, 33, pk_ref.compressed_form); - jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); - (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) { - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); - hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); - LDKCVec_u5Z data_without_signature_constr; - data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature); - if (data_without_signature_constr.datalen > 0) - data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); - else - data_without_signature_constr.data = NULL; - int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL); - for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { - int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; - - data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 }; - } - (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0); - LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj; + LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); - (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0); return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKLevel* orig_conv = (LDKLevel*)(orig & ~1); - jclass ret_conv = LDKLevel_to_java(env, Level_clone(orig_conv)); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_gossip()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_trace()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_debug()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_info()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_warn()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_error()); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKLevel* a_conv = (LDKLevel*)(a & ~1); - LDKLevel* b_conv = (LDKLevel*)(b & ~1); - jboolean ret_conv = Level_eq(a_conv, b_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Level_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKLevel* o_conv = (LDKLevel*)(o & ~1); - int64_t ret_conv = Level_hash(o_conv); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKLevel_to_java(env, Level_max()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRecord this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHTLCUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Record_free(this_obj_conv); -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv)); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKLevel val_conv = LDKLevel_from_java(env, val); - Record_set_level(&this_ptr_conv, val_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = Record_get_args(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - Record_set_args(&this_ptr_conv, val_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = Record_get_module_path(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - Record_set_module_path(&this_ptr_conv, val_conv); -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = Record_get_file(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - Record_set_file(&this_ptr_conv, val_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = Record_get_line(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - Record_set_line(&this_ptr_conv, val); + HTLCUpdate_free(this_obj_conv); } -static inline uintptr_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { - LDKRecord ret_var = Record_clone(arg); +static inline uintptr_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24199,21 +26480,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRecord arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Record_clone_ptr(&arg_conv); + int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRecord orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKRecord ret_var = Record_clone(&orig_conv); + LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24225,106 +26506,102 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHTLCUpdate obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_HTLCUpdate_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_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = HTLCUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); + LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); FREE((void*)this_ptr); - Logger_free(this_ptr_conv); + Balance_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelHandshakeConfig this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelHandshakeConfig_free(this_obj_conv); +static inline uintptr_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBalance* arg_conv = (LDKBalance*)arg; + int64_t ret_conv = Balance_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBalance* orig_conv = (LDKBalance*)orig; + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t confirmation_height) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1contentious_1claimable(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t timeout_height) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1claimable_1htlcawaiting_1timeout(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t claimable_height) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Balance_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKBalance* a_conv = (LDKBalance*)a; + LDKBalance* b_conv = (LDKBalance*)b; + jboolean ret_conv = Balance_eq(a_conv, b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg, jboolean negotiate_scid_privacy_arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg, negotiate_scid_privacy_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelMonitor this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelMonitor_free(this_obj_conv); } -static inline uintptr_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); +static inline uintptr_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24335,21 +26612,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelHandshakeConfig arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelHandshakeConfig orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelMonitor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); + LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24361,165 +26638,504 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clo return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelMonitor obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelHandshakeLimits this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelHandshakeLimits_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelMonitorUpdate updates_conv; + updates_conv.inner = (void*)(updates & (~1)); + updates_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); + return ((int64_t)ret_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&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 o = 0; o < ret_var.datalen; o++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv_40_conv = ret_var.data[o]; + ret_arr_ptr[o] = ((int64_t)ret_conv_40_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t filter) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* filter_ptr = (void*)(((uintptr_t)filter) & ~1); + if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } + LDKFilter* filter_conv = (LDKFilter*)filter_ptr; + ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&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 o = 0; o < ret_var.datalen; o++) { + LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_conv_14_copy = ret_var.data[o]; + int64_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; + ret_arr_ptr[o] = ret_conv_14_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&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 h = 0; h < ret_var.datalen; h++) { + LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_conv_7_copy = ret_var.data[h]; + int64_t ret_conv_7_ref = (uintptr_t)ret_conv_7_copy; + ret_arr_ptr[h] = ret_conv_7_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_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); - return ret_conv; +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + LDKTransaction ret_conv_8_var = ret_var.data[i]; + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data); + Transaction_free(ret_conv_8_var); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t n = 0; n < ret_var.datalen; n++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_39_conv = ret_var.data[n]; + ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t n = 0; n < ret_var.datalen; n++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_39_conv = ret_var.data[n]; + ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char txid_arr[32]; + CHECK((*env)->GetArrayLength(env, txid) == 32); + (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); + unsigned char (*txid_ref)[32] = &txid_arr; + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char header_arr[80]; + CHECK((*env)->GetArrayLength(env, header) == 80); + (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); + unsigned char (*header_ref)[80] = &header_arr; + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); + CHECK_ACCESS(broadcaster_ptr); + LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); + if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t n = 0; n < ret_var.datalen; n++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_39_conv = ret_var.data[n]; + ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelMonitor this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&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 j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + int64_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; + ret_arr_ptr[j] = ret_conv_9_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr; + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOutPoint this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OutPoint_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelHandshakeLimits this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + OutPoint_set_txid(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); + int16_t ret_conv = OutPoint_get_index(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); + OutPoint_set_index(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv *env, jclass clz, int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) { + LDKThirtyTwoBytes txid_arg_ref; + CHECK((*env)->GetArrayLength(env, txid_arg) == 32); + (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data); + LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24531,8 +27147,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new return ret_ref; } -static inline uintptr_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +static inline uintptr_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24543,21 +27159,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelHandshakeLimits arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOutPoint arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv); + int64_t ret_conv = OutPoint_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelHandshakeLimits orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOutPoint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); + LDKOutPoint ret_var = OutPoint_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24569,148 +27185,227 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clo return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOutPoint a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKOutPoint b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelConfig this_obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKOutPoint o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + int64_t ret_conv = OutPoint_hash(&o_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOutPoint this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOutPoint obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_OutPoint_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = OutPoint_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelConfig_free(this_obj_conv); + DelayedPaymentOutputDescriptor_free(this_obj_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); + int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelConfig_get_announced_channel(&this_ptr_conv); - return ret_conv; + DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_announced_channel(&this_ptr_conv, val); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); + DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1close_1avoidance_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); + DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { - LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int8_tArray revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); + outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKPublicKey per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); + void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); + LDKPublicKey revocation_pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, revocation_pubkey_arg, 0, 33, revocation_pubkey_arg_ref.compressed_form); + LDKThirtyTwoBytes channel_keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24722,8 +27417,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * return ret_ref; } -static inline uintptr_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { - LDKChannelConfig ret_var = ChannelConfig_clone(arg); +static inline uintptr_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24734,34 +27429,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelConfig arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv); + int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelConfig orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) { - LDKChannelConfig ret_var = ChannelConfig_default(); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24773,102 +27455,42 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIE return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelConfig obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); + LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = ChannelConfig_read(ser_ref); + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUserConfig this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UserConfig_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelHandshakeConfig val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelHandshakeConfig_clone(&val_conv); - UserConfig_set_own_channel_config(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelHandshakeLimits val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelHandshakeLimits_clone(&val_conv); - UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv); + StaticPaymentOutputDescriptor_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); + LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24880,87 +27502,83 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1o return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUserConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelConfig val_conv; + LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelConfig_clone(&val_conv); - UserConfig_set_channel_options(&this_ptr_conv, val_conv); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); - return ret_conv; + val_conv = OutPoint_clone(&val_conv); + StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); + val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); + StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UserConfig_set_accept_inbound_channels(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUserConfig this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg) { - LDKChannelHandshakeConfig own_channel_config_arg_conv; - own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); - own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv); - own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv); - LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv; - peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1)); - peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv); - peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv); - LDKChannelConfig channel_options_arg_conv; - channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); - channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); - channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); - LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); + outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); + CHECK_ACCESS(output_arg_ptr); + LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); + output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); + LDKThirtyTwoBytes channel_keys_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24972,8 +27590,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env return ret_ref; } -static inline uintptr_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { - LDKUserConfig ret_var = UserConfig_clone(arg); +static inline uintptr_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -24984,21 +27602,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUserConfig arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UserConfig_clone_ptr(&arg_conv); + int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUserConfig orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUserConfig ret_var = UserConfig_clone(&orig_conv); + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25010,287 +27628,396 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *e return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) { - LDKUserConfig ret_var = UserConfig_default(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKStaticPaymentOutputDescriptor obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBestBlock this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BestBlock_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -static inline uintptr_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { - LDKBestBlock ret_var = BestBlock_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + FREE((void*)this_ptr); + SpendableOutputDescriptor_free(this_ptr_conv); } + +static inline uintptr_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBestBlock arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = BestBlock_clone_ptr(&arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; + int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBestBlock orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKBestBlock ret_var = BestBlock_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) { - LDKNetwork network_conv = LDKNetwork_from_java(env, network); - LDKBestBlock ret_var = BestBlock_from_genesis(network_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = (void*)(outpoint & (~1)); + outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + void* output_ptr = (void*)(((uintptr_t)output) & ~1); + CHECK_ACCESS(output_ptr); + LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); + output_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output) & ~1)); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) { - LDKThirtyTwoBytes block_hash_ref; - CHECK((*env)->GetArrayLength(env, block_hash) == 32); - (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data); - LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { + LDKDelayedPaymentOutputDescriptor a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data); - return ret_arr; -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int32_t ret_conv = BestBlock_height(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAccessError* orig_conv = (LDKAccessError*)(orig & ~1); - jclass ret_conv = LDKAccessError_to_java(env, AccessError_clone(orig_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { + LDKStaticPaymentOutputDescriptor a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1chain(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_chain()); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj; + LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1tx(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_tx()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = SpendableOutputDescriptor_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr); + LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr); FREE((void*)this_ptr); - Access_free(this_ptr_conv); + BaseSign_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); - FREE((void*)this_ptr); - Listen_free(this_ptr_conv); +static inline uintptr_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = Sign_clone(arg); + return (int64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSign* arg_conv = (LDKSign*)arg_ptr; + int64_t ret_conv = Sign_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); + if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } + LDKSign* orig_conv = (LDKSign*)orig_ptr; + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = Sign_clone(orig_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); + LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr); FREE((void*)this_ptr); - Confirm_free(this_ptr_conv); + Sign_free(this_ptr_conv); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)(orig & ~1); - jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_clone(orig_conv)); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecipient* orig_conv = (LDKRecipient*)(orig & ~1); + jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv)); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_temporary_failure()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRecipient_to_java(env, Recipient_node()); return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_permanent_failure()); +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node()); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); - FREE((void*)this_ptr); - Watch_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); + LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr); FREE((void*)this_ptr); - Filter_free(this_ptr_conv); + KeysInterface_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKWatchedOutput this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInMemorySigner this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - WatchedOutput_free(this_obj_conv); + InMemorySigner_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; + LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - WatchedOutput_set_block_hash(&this_ptr_conv, val_ref); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&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); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKWatchedOutput this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv *env, jclass clz, int8_tArray block_hash_arg, int64_t outpoint_arg, int8_tArray script_pubkey_arg) { - LDKThirtyTwoBytes block_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, block_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, block_hash_arg, 0, 32, block_hash_arg_ref.data); - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); - outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKCVec_u8Z script_pubkey_arg_ref; - script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg); - script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data); - LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSecretKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); + InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKInMemorySigner this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); +} + +static inline uintptr_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInMemorySigner arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInMemorySigner orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray node_secret, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) { + LDKSecretKey node_secret_ref; + CHECK((*env)->GetArrayLength(env, node_secret) == 32); + (*env)->GetByteArrayRegion(env, node_secret, 0, 32, node_secret_ref.bytes); + LDKSecretKey funding_key_ref; + CHECK((*env)->GetArrayLength(env, funding_key) == 32); + (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes); + LDKSecretKey revocation_base_key_ref; + CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32); + (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes); + LDKSecretKey payment_key_ref; + CHECK((*env)->GetArrayLength(env, payment_key) == 32); + (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes); + LDKSecretKey delayed_payment_base_key_ref; + CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32); + (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes); + LDKSecretKey htlc_base_key_ref; + CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); + (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes); + LDKThirtyTwoBytes commitment_seed_ref; + CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); + (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data); + LDKThirtyTwoBytes channel_keys_id_ref; + CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); + (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); + LDKInMemorySigner ret_var = InMemorySigner_new(node_secret_ref, funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25302,33 +28029,39 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * return ret_ref; } -static inline uintptr_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { - LDKWatchedOutput ret_var = WatchedOutput_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); + return ret_conv; } - return ret_ref; + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKWatchedOutput arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKWatchedOutput orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25340,96 +28073,129 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKWatchedOutput o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = WatchedOutput_hash(&o_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); - FREE((void*)this_ptr); - BroadcasterInterface_free(this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv); + return ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)(orig & ~1); - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_clone(orig_conv)); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); + spend_tx_ref.data_is_owned = true; + LDKStaticPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = (void*)(descriptor & (~1)); + descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return (int64_t)ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTransaction spend_tx_ref; + spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); + spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); + spend_tx_ref.data_is_owned = true; + LDKDelayedPaymentOutputDescriptor descriptor_conv; + descriptor_conv.inner = (void*)(descriptor & (~1)); + descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + return (int64_t)ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); + *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority()); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInMemorySigner this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)(a & ~1); - LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)(b & ~1); - jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInMemorySigner obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); - FREE((void*)this_ptr); - FeeEstimator_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int8_tArray arg) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKSecretKey arg_ref; + CHECK((*env)->GetArrayLength(env, arg) == 32); + (*env)->GetByteArrayRegion(env, arg, 0, 32, arg_ref.bytes); + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = InMemorySigner_read(ser_ref, arg_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMonitorUpdateId this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKKeysManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MonitorUpdateId_free(this_obj_conv); -} - -static inline uintptr_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKMonitorUpdateId arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv); - return ret_conv; + KeysManager_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKMonitorUpdateId orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { + unsigned char seed_arr[32]; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); + unsigned char (*seed_ref)[32] = &seed_arr; + LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25441,94 +28207,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIE return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKMonitorUpdateId o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = MonitorUpdateId_hash(&o_conv); - return ret_conv; -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKMonitorUpdateId a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKMonitorUpdateId b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); - FREE((void*)this_ptr); - Persist_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKLockedChannelMonitor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - LockedChannelMonitor_free(this_obj_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChainMonitor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChainMonitor_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *env, jclass clz, int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) { - void* chain_source_ptr = (void*)(((uintptr_t)chain_source) & ~1); - CHECK_ACCESS(chain_source_ptr); - LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (chain_source_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&chain_source_conv.some); - } - } - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* feeest_ptr = (void*)(((uintptr_t)feeest) & ~1); - CHECK_ACCESS(feeest_ptr); - LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); - if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&feeest_conv); - } - void* persister_ptr = (void*)(((uintptr_t)persister) & ~1); - CHECK_ACCESS(persister_ptr); - LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); - if (persister_conv.free == LDKPersist_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKPersist_JCalls_cloned(&persister_conv); - } - LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKKeysManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char params_arr[32]; + CHECK((*env)->GetArrayLength(env, params) == 32); + (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); + unsigned char (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25540,171 +28228,253 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray ignored_channels) { - LDKChainMonitor this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) { + LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_ChannelDetailsZ ignored_channels_constr; - ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels); - if (ignored_channels_constr.datalen > 0) - ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else - ignored_channels_constr.data = NULL; - int64_t* ignored_channels_vals = (*env)->GetLongArrayElements (env, ignored_channels, NULL); - for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { - int64_t ignored_channels_conv_16 = ignored_channels_vals[q]; - LDKChannelDetails ignored_channels_conv_16_conv; - ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1)); - ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); - ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); - ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; + descriptors_constr.data = NULL; + int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); + descriptors_constr.data[b] = descriptors_conv_27_conv; } - (*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0); - LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); - 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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - int64_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; - ret_arr_ptr[j] = ret_conv_9_ref; + (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); + LDKCVec_TxOutZ outputs_constr; + outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + outputs_constr.data = NULL; + int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); + for (size_t h = 0; h < outputs_constr.datalen; h++) { + int64_t outputs_conv_7 = outputs_vals[h]; + void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); + CHECK_ACCESS(outputs_conv_7_ptr); + LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); + outputs_constr.data[h] = outputs_conv_7_conv; } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); + LDKCVec_u8Z change_destination_script_ref; + change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); + change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo) { - LDKChainMonitor this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = (void*)(funding_txo & (~1)); - funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); - return (int64_t)ret_conv; + LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); + *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPhantomKeysManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PhantomKeysManager_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&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 k = 0; k < ret_var.datalen; k++) { - LDKOutPoint ret_conv_10_var = ret_var.data[k]; - int64_t ret_conv_10_ref = 0; - CHECK((((uintptr_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); - ret_conv_10_ref = (uintptr_t)ret_conv_10_var.inner; - if (ret_conv_10_var.is_owned) { - ret_conv_10_ref |= 1; - } - ret_arr_ptr[k] = ret_conv_10_ref; + LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); + *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { + unsigned char seed_arr[32]; + CHECK((*env)->GetArrayLength(env, seed) == 32); + (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); + unsigned char (*seed_ref)[32] = &seed_arr; + unsigned char cross_node_seed_arr[32]; + CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32); + (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr); + unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr; + LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) { - LDKChainMonitor this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = (void*)(funding_txo & (~1)); - funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorUpdateId completed_update_id_conv; - completed_update_id_conv.inner = (void*)(completed_update_id & (~1)); - completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); - completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + descriptors_constr.data = NULL; + int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); + descriptors_constr.data[b] = descriptors_conv_27_conv; + } + (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); + LDKCVec_TxOutZ outputs_constr; + outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + outputs_constr.data = NULL; + int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); + for (size_t h = 0; h < outputs_constr.datalen; h++) { + int64_t outputs_conv_7 = outputs_vals[h]; + void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); + CHECK_ACCESS(outputs_conv_7_ptr); + LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); + outputs_constr.data[h] = outputs_conv_7_conv; + } + (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); + LDKCVec_u8Z change_destination_script_ref; + change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); + change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { + LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); - *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); - return (int64_t)ret_ret; + unsigned char params_arr[32]; + CHECK((*env)->GetArrayLength(env, params) == 32); + (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); + unsigned char (*params_ref)[32] = ¶ms_arr; + LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChainMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelManager_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelMonitorUpdate this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChainParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelMonitorUpdate_free(this_obj_conv); + ChainParameters_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1network(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); + jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv)); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelMonitorUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); + LDKNetwork val_conv = LDKNetwork_from_java(env, val); + ChainParameters_set_network(&this_ptr_conv, val_conv); } -static inline uintptr_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChainParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChainParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKBestBlock val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = BestBlock_clone(&val_conv); + ChainParameters_set_best_block(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv *env, jclass clz, jclass network_arg, int64_t best_block_arg) { + LDKNetwork network_arg_conv = LDKNetwork_from_java(env, network_arg); + LDKBestBlock best_block_arg_conv; + best_block_arg_conv.inner = (void*)(best_block_arg & (~1)); + best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); + best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); + LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25715,21 +28485,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelMonitorUpdate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChainParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelMonitorUpdate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChainParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); + LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25741,134 +28511,80 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelMonitorUpdate obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyForwardingInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCounterpartyForwardingInfo this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CounterpartyForwardingInfo_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_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_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = ChannelMonitorUpdate_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); - FREE((void*)this_ptr); - MonitorEvent_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); } -static inline uintptr_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; - int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) { - LDKHTLCUpdate a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = HTLCUpdate_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_htlcevent(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz, int64_t a) { - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) { - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = (void*)(funding_txo & (~1)); - funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) { - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_update_failed(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj; - LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = MonitorEvent_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKHTLCUpdate this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCUpdate_free(this_obj_conv); -} - -static inline uintptr_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { - LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +static inline uintptr_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25879,21 +28595,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHTLCUpdate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyForwardingInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHTLCUpdate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCounterpartyForwardingInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -25905,102 +28621,196 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *e return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHTLCUpdate obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelCounterparty_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelCounterparty this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelCounterparty_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_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_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = HTLCUpdate_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); - FREE((void*)this_ptr); - Balance_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); } -static inline uintptr_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBalance* arg_conv = (LDKBalance*)arg; - int64_t ret_conv = Balance_clone_ptr(arg_conv); + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKInitFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InitFeatures_clone(&val_conv); + ChannelCounterparty_set_features(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBalance* orig_conv = (LDKBalance*)orig; - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis); - int64_t ret_ref = (uintptr_t)ret_copy; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1awaiting_1confirmations(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t confirmation_height) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCounterpartyForwardingInfo val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CounterpartyForwardingInfo_clone(&val_conv); + ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1contentious_1claimable(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t timeout_height) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1maybe_1claimable_1htlcawaiting_1timeout(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis, int32_t claimable_height) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1outbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Balance_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKBalance* a_conv = (LDKBalance*)a; - LDKBalance* b_conv = (LDKBalance*)b; - jboolean ret_conv = Balance_eq(a_conv, b_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1outbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelMonitor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelMonitor_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JNIEnv *env, jclass clz, int8_tArray node_id_arg, int64_t features_arg, int64_t unspendable_punishment_reserve_arg, int64_t forwarding_info_arg, int64_t outbound_htlc_minimum_msat_arg, int64_t outbound_htlc_maximum_msat_arg) { + LDKPublicKey node_id_arg_ref; + CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); + (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); + LDKInitFeatures features_arg_conv; + features_arg_conv.inner = (void*)(features_arg & (~1)); + features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = InitFeatures_clone(&features_arg_conv); + LDKCounterpartyForwardingInfo forwarding_info_arg_conv; + forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1)); + forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); + forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); + void* outbound_htlc_minimum_msat_arg_ptr = (void*)(((uintptr_t)outbound_htlc_minimum_msat_arg) & ~1); + CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr); + outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)outbound_htlc_minimum_msat_arg) & ~1)); + void* outbound_htlc_maximum_msat_arg_ptr = (void*)(((uintptr_t)outbound_htlc_maximum_msat_arg) & ~1); + CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr); + outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)outbound_htlc_maximum_msat_arg) & ~1)); + LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv, outbound_htlc_minimum_msat_arg_conv, outbound_htlc_maximum_msat_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline uintptr_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { - LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +static inline uintptr_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -26011,21 +28821,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelMonitor arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelCounterparty arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelMonitor orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelCounterparty orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -26037,409 +28847,41 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEn return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelMonitor obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelMonitor_1update_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelMonitorUpdate updates_conv; - updates_conv.inner = (void*)(updates & (~1)); - updates_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); - *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); - return ((int64_t)ret_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&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 o = 0; o < ret_var.datalen; o++) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); - *ret_conv_40_conv = ret_var.data[o]; - ret_arr_ptr[o] = ((int64_t)ret_conv_40_conv); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t filter) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* filter_ptr = (void*)(((uintptr_t)filter) & ~1); - if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } - LDKFilter* filter_conv = (LDKFilter*)filter_ptr; - ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&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 o = 0; o < ret_var.datalen; o++) { - LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_conv_14_copy = ret_var.data[o]; - int64_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; - ret_arr_ptr[o] = ret_conv_14_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&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 h = 0; h < ret_var.datalen; h++) { - LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_conv_7_copy = ret_var.data[h]; - int64_t ret_conv_7_ref = (uintptr_t)ret_conv_7_copy; - ret_arr_ptr[h] = ret_conv_7_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - LDKTransaction ret_conv_8_var = ret_var.data[i]; - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data); - Transaction_free(ret_conv_8_var); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = (*env)->GetArrayLength(env, txdata); - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL); - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0); - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char txid_arr[32]; - CHECK((*env)->GetArrayLength(env, txid) == 32); - (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); - unsigned char (*txid_ref)[32] = &txid_arr; - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelDetails this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelDetails_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char header_arr[80]; - CHECK((*env)->GetArrayLength(env, header) == 80); - (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); - unsigned char (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); - CHECK_ACCESS(broadcaster_ptr); - LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t n = 0; n < ret_var.datalen; n++) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((int64_t)ret_conv_39_conv); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); - } - - FREE(ret_var.data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -26451,533 +28893,488 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1be return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - int64_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; - ret_arr_ptr[j] = ret_conv_9_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_C2Tuple_1BlockHashChannelMonitorZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); - if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } - LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr; - LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); - *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelCounterparty val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelCounterparty_clone(&val_conv); + ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOutPoint this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OutPoint_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOutPoint this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv)); - return ret_arr; + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOutPoint this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - OutPoint_set_txid(&this_ptr_conv, val_ref); + LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } + return ret_ref; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOutPoint this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = OutPoint_get_index(&this_ptr_conv); - return ret_conv; + LDKChannelTypeFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTypeFeatures_clone(&val_conv); + ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKOutPoint this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OutPoint_set_index(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) { - LDKThirtyTwoBytes txid_arg_ref; - CHECK((*env)->GetArrayLength(env, txid_arg) == 32); - (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data); - LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static inline uintptr_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { - LDKOutPoint ret_var = OutPoint_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); } + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOutPoint arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = OutPoint_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOutPoint orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKOutPoint ret_var = OutPoint_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKOutPoint a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKOutPoint b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKOutPoint o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = OutPoint_hash(&o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKOutPoint this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOutPoint obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = OutPoint_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDelayedPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DelayedPaymentOutputDescriptor_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); + ChannelDetails_set_user_channel_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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 = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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 = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); + ChannelDetails_set_balance_msat(&this_ptr_conv, val); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +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 = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); + int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); + ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1next_1outbound_1htlc_1limit_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); - DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); + int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1next_1outbound_1htlc_1limit_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; + ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref); + int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); - return ret_arr; + ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKDelayedPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int8_tArray revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); - outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKPublicKey per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); - void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); - LDKPublicKey revocation_pubkey_arg_ref; - CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33); - (*env)->GetByteArrayRegion(env, revocation_pubkey_arg, 0, 33, revocation_pubkey_arg_ref.compressed_form); - LDKThirtyTwoBytes channel_keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static inline uintptr_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDelayedPaymentOutputDescriptor arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDelayedPaymentOutputDescriptor orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelDetails_set_is_outbound(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKDelayedPaymentOutputDescriptor obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelDetails_set_is_channel_ready(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKStaticPaymentOutputDescriptor this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - StaticPaymentOutputDescriptor_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + ChannelDetails_set_is_usable(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); + jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); - StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); + ChannelDetails_set_is_public(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); - return ret_arr; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKStaticPaymentOutputDescriptor this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); - outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); - CHECK_ACCESS(output_arg_ptr); - LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); - LDKThirtyTwoBytes channel_keys_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data); - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray 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, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t next_outbound_htlc_limit_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, jboolean is_usable_arg, jboolean is_public_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKChannelCounterparty counterparty_arg_conv; + counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); + counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); + counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); + LDKOutPoint funding_txo_arg_conv; + funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1)); + funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); + funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); + LDKChannelTypeFeatures channel_type_arg_conv; + channel_type_arg_conv.inner = (void*)(channel_type_arg & (~1)); + channel_type_arg_conv.is_owned = (channel_type_arg & 1) || (channel_type_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); + channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); + void* short_channel_id_arg_ptr = (void*)(((uintptr_t)short_channel_id_arg) & ~1); + CHECK_ACCESS(short_channel_id_arg_ptr); + LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); + short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_arg) & ~1)); + void* outbound_scid_alias_arg_ptr = (void*)(((uintptr_t)outbound_scid_alias_arg) & ~1); + CHECK_ACCESS(outbound_scid_alias_arg_ptr); + LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr); + outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)outbound_scid_alias_arg) & ~1)); + void* inbound_scid_alias_arg_ptr = (void*)(((uintptr_t)inbound_scid_alias_arg) & ~1); + CHECK_ACCESS(inbound_scid_alias_arg_ptr); + LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr); + inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)inbound_scid_alias_arg) & ~1)); + void* unspendable_punishment_reserve_arg_ptr = (void*)(((uintptr_t)unspendable_punishment_reserve_arg) & ~1); + CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); + LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); + void* confirmations_required_arg_ptr = (void*)(((uintptr_t)confirmations_required_arg) & ~1); + CHECK_ACCESS(confirmations_required_arg_ptr); + LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr); + confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)confirmations_required_arg) & ~1)); + void* force_close_spend_delay_arg_ptr = (void*)(((uintptr_t)force_close_spend_delay_arg) & ~1); + CHECK_ACCESS(force_close_spend_delay_arg_ptr); + LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); + force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)force_close_spend_delay_arg) & ~1)); + void* inbound_htlc_minimum_msat_arg_ptr = (void*)(((uintptr_t)inbound_htlc_minimum_msat_arg) & ~1); + CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr); + inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)inbound_htlc_minimum_msat_arg) & ~1)); + void* inbound_htlc_maximum_msat_arg_ptr = (void*)(((uintptr_t)inbound_htlc_maximum_msat_arg) & ~1); + CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr); + inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)inbound_htlc_maximum_msat_arg) & ~1)); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, 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, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -26989,8 +29386,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript return ret_ref; } -static inline uintptr_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +static inline uintptr_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27001,21 +29398,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKStaticPaymentOutputDescriptor arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelDetails arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKStaticPaymentOutputDescriptor orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelDetails orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); + LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27027,317 +29424,276 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKStaticPaymentOutputDescriptor obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelDetails this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); - *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelDetails this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); + LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); FREE((void*)this_ptr); - SpendableOutputDescriptor_free(this_ptr_conv); + PaymentSendFailure_free(this_ptr_conv); } -static inline uintptr_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(arg); +static inline uintptr_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; - int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg; + int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(orig_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) { - LDKOutPoint outpoint_conv; - outpoint_conv.inner = (void*)(outpoint & (~1)); - outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); - outpoint_conv = OutPoint_clone(&outpoint_conv); - void* output_ptr = (void*)(((uintptr_t)output) & ~1); - CHECK_ACCESS(output_ptr); - LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); - output_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output) & ~1)); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = (void*)(((uintptr_t)a) & ~1); + CHECK_ACCESS(a_ptr); + LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); + a_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a) & ~1)); + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_parameter_error(a_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { - LDKDelayedPaymentOutputDescriptor a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_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 = (void*)(((uintptr_t)a_conv_22) & ~1); + 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*)(((uintptr_t)a_conv_22) & ~1)); + 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 = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) { - LDKStaticPaymentOutputDescriptor a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = (a & 1) || (a == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); - LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_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 = (void*)(((uintptr_t)a_conv_10) & ~1); + CHECK_ACCESS(a_conv_10_ptr); + LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); + a_conv_10_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a_conv_10) & ~1)); + 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_retry_safe(a_constr); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj; - LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); - *ret_conv = SpendableOutputDescriptor_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr); - FREE((void*)this_ptr); - BaseSign_free(this_ptr_conv); -} - -static inline uintptr_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { - LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); - *ret_ret = Sign_clone(arg); - return (int64_t)ret_ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); - if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } - LDKSign* arg_conv = (LDKSign*)arg_ptr; - int64_t ret_conv = Sign_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); - if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } - LDKSign* orig_conv = (LDKSign*)orig_ptr; - LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); - *ret_ret = Sign_clone(orig_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr); - FREE((void*)this_ptr); - Sign_free(this_ptr_conv); -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRecipient* orig_conv = (LDKRecipient*)(orig & ~1); - jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv)); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRecipient_to_java(env, Recipient_node()); - return ret_conv; -} - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) { - jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node()); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr); - FREE((void*)this_ptr); - KeysInterface_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) { + LDKCVec_CResult_NoneAPIErrorZZ results_constr; + results_constr.datalen = (*env)->GetArrayLength(env, results); + if (results_constr.datalen > 0) + results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); + else + results_constr.data = NULL; + int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL); + for (size_t w = 0; w < results_constr.datalen; w++) { + int64_t results_conv_22 = results_vals[w]; + void* results_conv_22_ptr = (void*)(((uintptr_t)results_conv_22) & ~1); + CHECK_ACCESS(results_conv_22_ptr); + LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); + results_constr.data[w] = results_conv_22_conv; + } + (*env)->ReleaseLongArrayElements(env, results, results_vals, 0); + LDKRouteParameters failed_paths_retry_conv; + failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1)); + failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0); + 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 = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInMemorySigner this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPhantomRouteHints this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InMemorySigner_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); + PhantomRouteHints_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); + LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; + if (ret_conv_16_var.is_owned) { + ret_conv_16_ref |= 1; + } + ret_arr_ptr[q] = ret_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); + LDKCVec_ChannelDetailsZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t q = 0; q < val_constr.datalen; q++) { + int64_t val_conv_16 = val_vals[q]; + LDKChannelDetails val_conv_16_conv; + val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); + val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); + val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv); + val_constr.data[q] = val_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); - return ret_arr; + int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); + PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSecretKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); - InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInMemorySigner this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKPhantomRouteHints this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); - return ret_arr; + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKInMemorySigner this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { + LDKCVec_ChannelDetailsZ channels_arg_constr; + channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg); + if (channels_arg_constr.datalen > 0) + channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + channels_arg_constr.data = NULL; + int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL); + for (size_t q = 0; q < channels_arg_constr.datalen; q++) { + int64_t channels_arg_conv_16 = channels_arg_vals[q]; + LDKChannelDetails channels_arg_conv_16_conv; + channels_arg_conv_16_conv.inner = (void*)(channels_arg_conv_16 & (~1)); + channels_arg_conv_16_conv.is_owned = (channels_arg_conv_16 & 1) || (channels_arg_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); + channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); + channels_arg_constr.data[q] = channels_arg_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0); + LDKPublicKey real_node_pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, real_node_pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, real_node_pubkey_arg, 0, 33, real_node_pubkey_arg_ref.compressed_form); + LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline uintptr_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { - LDKInMemorySigner ret_var = InMemorySigner_clone(arg); +static inline uintptr_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { + LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27348,21 +29704,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInMemorySigner arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPhantomRouteHints arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv); + int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInMemorySigner orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPhantomRouteHints orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); + LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27374,32 +29730,53 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEn return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray node_secret, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) { - LDKSecretKey node_secret_ref; - CHECK((*env)->GetArrayLength(env, node_secret) == 32); - (*env)->GetByteArrayRegion(env, node_secret, 0, 32, node_secret_ref.bytes); - LDKSecretKey funding_key_ref; - CHECK((*env)->GetArrayLength(env, funding_key) == 32); - (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes); - LDKSecretKey revocation_base_key_ref; - CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32); - (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes); - LDKSecretKey payment_key_ref; - CHECK((*env)->GetArrayLength(env, payment_key) == 32); - (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes); - LDKSecretKey delayed_payment_base_key_ref; - CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32); - (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes); - LDKSecretKey htlc_base_key_ref; - CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); - (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes); - LDKThirtyTwoBytes commitment_seed_ref; - CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); - (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data); - LDKThirtyTwoBytes channel_keys_id_ref; - CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32); - (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data); - LDKInMemorySigner ret_var = InMemorySigner_new(node_secret_ref, funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref); +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 logger, int64_t keys_manager, int64_t config, int64_t params) { + void* fee_est_ptr = (void*)(((uintptr_t)fee_est) & ~1); + CHECK_ACCESS(fee_est_ptr); + LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); + if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_est_conv); + } + void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); + CHECK_ACCESS(keys_manager_ptr); + LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); + if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKeysInterface_JCalls_cloned(&keys_manager_conv); + } + LDKUserConfig config_conv; + config_conv.inner = (void*)(config & (~1)); + config_conv.is_owned = (config & 1) || (config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv = UserConfig_clone(&config_conv); + LDKChainParameters params_conv; + params_conv.inner = (void*)(params & (~1)); + params_conv.is_owned = (params & 1) || (params == 0); + 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, logger_conv, keys_manager_conv, config_conv, params_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27411,12 +29788,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1current_1default_1configuration(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); + LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27428,407 +29805,427 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart return ret_ref; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int64_t user_channel_id, int64_t override_config) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); - return ret_conv; + LDKPublicKey their_network_key_ref; + CHECK((*env)->GetArrayLength(env, their_network_key) == 33); + (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form); + LDKUserConfig override_config_conv; + override_config_conv.inner = (void*)(override_config & (~1)); + override_config_conv.is_owned = (override_config & 1) || (override_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); + override_config_conv = UserConfig_clone(&override_config_conv); + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); + return (int64_t)ret_conv; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); - return ret_conv; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; + if (ret_conv_16_var.is_owned) { + ret_conv_16_ref |= 1; + } + ret_arr_ptr[q] = ret_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv); - return ret_conv; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; + if (ret_conv_16_var.is_owned) { + ret_conv_16_ref |= 1; + } + ret_arr_ptr[q] = ret_conv_16_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_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + unsigned char channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, channel_id) == 32); + (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); + unsigned char (*channel_id_ref)[32] = &channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel_1with_1target_1feerate(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id, int32_t target_feerate_sats_per_1000_weight) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + unsigned char channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, channel_id) == 32); + (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); + unsigned char (*channel_id_ref)[32] = &channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight); + return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv); - return ret_conv; + unsigned char channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, channel_id) == 32); + (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); + unsigned char (*channel_id_ref)[32] = &channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_force_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); - spend_tx_ref.data_is_owned = true; - LDKStaticPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = (void*)(descriptor & (~1)); - descriptor_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return (int64_t)ret_conv; + ChannelManager_force_close_all_channels(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTransaction spend_tx_ref; - spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); - spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data); - spend_tx_ref.data_is_owned = true; - LDKDelayedPaymentOutputDescriptor descriptor_conv; - descriptor_conv.inner = (void*)(descriptor & (~1)); - descriptor_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); - LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); - *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); + LDKRoute route_conv; + route_conv.inner = (void*)(route & (~1)); + route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_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_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSign(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); - *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); - return (int64_t)ret_ret; + LDKRoute route_conv; + route_conv.inner = (void*)(route & (~1)); + route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_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_retry_payment(&this_arg_conv, &route_conv, payment_id_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInMemorySigner this_arg_conv; +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 = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); - *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); - return (int64_t)ret_ret; + 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); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInMemorySigner obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKRoute route_conv; + route_conv.inner = (void*)(route & (~1)); + route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int8_tArray arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKSecretKey arg_ref; - CHECK((*env)->GetArrayLength(env, arg) == 32); - (*env)->GetByteArrayRegion(env, arg, 0, 32, arg_ref.bytes); - LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); - *ret_conv = InMemorySigner_read(ser_ref, arg_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char temporary_channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); + (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); + unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; + 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); + LDKTransaction funding_transaction_ref; + funding_transaction_ref.datalen = (*env)->GetArrayLength(env, funding_transaction); + funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data); + funding_transaction_ref.data_is_owned = true; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKKeysManager this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - KeysManager_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray rgb, int8_tArray alias, int64_tArray addresses) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKThreeBytes rgb_ref; + CHECK((*env)->GetArrayLength(env, rgb) == 3); + (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data); + LDKThirtyTwoBytes alias_ref; + CHECK((*env)->GetArrayLength(env, alias) == 32); + (*env)->GetByteArrayRegion(env, alias, 0, 32, alias_ref.data); + LDKCVec_NetAddressZ addresses_constr; + addresses_constr.datalen = (*env)->GetArrayLength(env, addresses); + if (addresses_constr.datalen > 0) + addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + else + addresses_constr.data = NULL; + int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL); + for (size_t m = 0; m < addresses_constr.datalen; m++) { + int64_t addresses_conv_12 = addresses_vals[m]; + void* addresses_conv_12_ptr = (void*)(((uintptr_t)addresses_conv_12) & ~1); + CHECK_ACCESS(addresses_conv_12_ptr); + LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr); + addresses_constr.data[m] = addresses_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); + ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { - unsigned char seed_arr[32]; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); - unsigned char (*seed_ref)[32] = &seed_arr; - LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelManager_process_pending_htlc_forwards(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKKeysManager this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char params_arr[32]; - CHECK((*env)->GetArrayLength(env, params) == 32); - (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); - unsigned char (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + ChannelManager_timer_tick_occurred(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) { - LDKKeysManager this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); + unsigned char payment_hash_arr[32]; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); + unsigned char (*payment_hash_ref)[32] = &payment_hash_arr; + ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char temporary_channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); + (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); + unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKKeysManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel_1from_1trusted_1peer_10conf(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t user_channel_id) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); - *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPhantomKeysManager this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomKeysManager_free(this_obj_conv); + unsigned char temporary_channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); + (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); + unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; + 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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPhantomKeysManager this_arg_conv; +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) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); - *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos, int8_tArray cross_node_seed) { - unsigned char seed_arr[32]; - CHECK((*env)->GetArrayLength(env, seed) == 32); - (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr); - unsigned char (*seed_ref)[32] = &seed_arr; - unsigned char cross_node_seed_arr[32]; - CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32); - (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr); - unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr; - LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) { - LDKPhantomKeysManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL); - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL); - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script); - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); + *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { - LDKPhantomKeysManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { + LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char params_arr[32]; - CHECK((*env)->GetArrayLength(env, params) == 32); - (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); - unsigned char (*params_ref)[32] = ¶ms_arr; - LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelManager this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelManager_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChainParameters this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChainParameters_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_secret_ref; + CHECK((*env)->GetArrayLength(env, payment_secret) == 32); + (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); + *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); + return (int64_t)ret_conv; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1network(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv)); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKNetwork val_conv = LDKNetwork_from_java(env, val); - ChainParameters_set_network(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27840,65 +30237,69 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_ return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChainParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKBestBlock val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = BestBlock_clone(&val_conv); - ChainParameters_set_best_block(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv *env, jclass clz, jclass network_arg, int64_t best_block_arg) { - LDKNetwork network_arg_conv = LDKNetwork_from_java(env, network_arg); - LDKBestBlock best_block_arg_conv; - best_block_arg_conv.inner = (void*)(best_block_arg & (~1)); - best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); - best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); - LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); + return (int64_t)ret_ret; } -static inline uintptr_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { - LDKChainParameters ret_var = ChainParameters_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChannelManager_as_Listen(&this_arg_conv); + return (int64_t)ret_ret; } - return ret_ref; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChainParameters arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update_1timeout(JNIEnv *env, jclass clz, int64_t this_arg, int64_t max_wait) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChainParameters orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelManager_await_persistable_update(&this_arg_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -27910,323 +30311,255 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCounterpartyForwardingInfo this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CounterpartyForwardingInfo_free(this_obj_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); + *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCounterpartyForwardingInfo obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_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_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CounterpartyForwardingInfo_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelCounterparty obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_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_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = ChannelCounterparty_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelDetails obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyForwardingInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_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_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = ChannelDetails_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -static inline uintptr_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCounterpartyForwardingInfo arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPhantomRouteHints obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCounterpartyForwardingInfo orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_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_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = PhantomRouteHints_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelCounterparty this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelCounterparty_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelManager obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelCounterparty_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelManagerReadArgs this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelManagerReadArgs_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); + if (val_conv.free == LDKKeysInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKeysInterface_JCalls_cloned(&val_conv); } - return ret_ref; + ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKInitFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = InitFeatures_clone(&val_conv); - ChannelCounterparty_set_features(&this_ptr_conv, val_conv); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); - return ret_conv; + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); + if (val_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); - int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKWatch val_conv = *(LDKWatch*)(val_ptr); + if (val_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&val_conv); } - return ret_ref; + ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCounterpartyForwardingInfo val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = CounterpartyForwardingInfo_clone(&val_conv); - ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JNIEnv *env, jclass clz, int8_tArray node_id_arg, int64_t features_arg, int64_t unspendable_punishment_reserve_arg, int64_t forwarding_info_arg) { - LDKPublicKey node_id_arg_ref; - CHECK((*env)->GetArrayLength(env, node_id_arg) == 33); - (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form); - LDKInitFeatures features_arg_conv; - features_arg_conv.inner = (void*)(features_arg & (~1)); - features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = InitFeatures_clone(&features_arg_conv); - LDKCounterpartyForwardingInfo forwarding_info_arg_conv; - forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1)); - forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); - forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); - LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -static inline uintptr_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelCounterparty arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv); - return ret_conv; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelCounterparty orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); + if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&val_conv); } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelDetails this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelDetails_free(this_obj_conv); + ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_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 = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv)); - return ret_arr; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKLogger val_conv = *(LDKLogger*)(val_ptr); + if (val_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); + LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28238,390 +30571,383 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counte return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelCounterparty val_conv; + LDKUserConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelCounterparty_clone(&val_conv); - ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); + val_conv = UserConfig_clone(&val_conv); + ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); + CHECK_ACCESS(keys_manager_ptr); + LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); + if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKeysInterface_JCalls_cloned(&keys_manager_conv); + } + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); + CHECK_ACCESS(fee_estimator_ptr); + LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); + if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); + } + void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); + } + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + LDKUserConfig default_config_conv; + default_config_conv.inner = (void*)(default_config & (~1)); + default_config_conv.is_owned = (default_config & 1) || (default_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); + default_config_conv = UserConfig_clone(&default_config_conv); + LDKCVec_ChannelMonitorZ channel_monitors_constr; + channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors); + if (channel_monitors_constr.datalen > 0) + channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); + else + channel_monitors_constr.data = NULL; + int64_t* channel_monitors_vals = (*env)->GetLongArrayElements (env, channel_monitors, NULL); + for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { + int64_t channel_monitors_conv_16 = channel_monitors_vals[q]; + LDKChannelMonitor channel_monitors_conv_16_conv; + channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1)); + channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); + channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0); + LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr); int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_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); + LDKChannelManagerReadArgs arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = (arg & 1) || (arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); + *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKExpandedKey this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ExpandedKey_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1new(JNIEnv *env, jclass clz, int8_tArray key_material) { + unsigned char key_material_arr[32]; + CHECK((*env)->GetArrayLength(env, key_material) == 32); + (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_arr); + unsigned char (*key_material_ref)[32] = &key_material_arr; + LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref); int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create(JNIEnv *env, jclass clz, int64_t keys, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t keys_manager, int64_t current_time) { + LDKExpandedKey keys_conv; + keys_conv.inner = (void*)(keys & (~1)); + keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); + if (!(keys_manager & 1)) { CHECK_ACCESS(keys_manager_ptr); } + LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr; + LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); + *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1from_1hash(JNIEnv *env, jclass clz, int64_t keys, int64_t min_value_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t current_time) { + LDKExpandedKey keys_conv; + keys_conv.inner = (void*)(keys & (~1)); + keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); + *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDecodeError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DecodeError_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); +static inline uintptr_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { + LDKDecodeError ret_var = DecodeError_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_user_channel_id(&this_ptr_conv, val); -} - -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 = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - 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 = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_balance_msat(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDecodeError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = DecodeError_clone_ptr(&arg_conv); + return ret_conv; } -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 = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDecodeError orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKDecodeError ret_var = DecodeError_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInit this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Init_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); - return ret_conv; + LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); + LDKInitFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = InitFeatures_clone(&val_conv); + Init_set_features(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = Init_get_remote_network_address(&this_ptr_conv); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); + LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr); + val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)(((uintptr_t)val) & ~1)); + Init_set_remote_network_address(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jclass clz, int64_t features_arg, int64_t remote_network_address_arg) { + LDKInitFeatures features_arg_conv; + features_arg_conv.inner = (void*)(features_arg & (~1)); + features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); + features_arg_conv = InitFeatures_clone(&features_arg_conv); + void* remote_network_address_arg_ptr = (void*)(((uintptr_t)remote_network_address_arg) & ~1); + CHECK_ACCESS(remote_network_address_arg_ptr); + LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr); + LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)val) & ~1)); - ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); +static inline uintptr_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { + LDKInit ret_var = Init_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); - return ret_conv; + return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_is_outbound(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInit arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = Init_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1funding_1locked(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelDetails_get_is_funding_locked(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInit orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKInit ret_var = Init_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1funding_1locked(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_is_funding_locked(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKErrorMessage this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErrorMessage_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_is_usable(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ErrorMessage_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelDetails_set_is_public(&this_ptr_conv, val); + LDKStr val_conv = java_to_owned_str(env, val); + ErrorMessage_set_data(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray 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 inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKChannelCounterparty counterparty_arg_conv; - counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); - counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); - counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); - LDKOutPoint funding_txo_arg_conv; - funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1)); - funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); - funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); - LDKChannelTypeFeatures channel_type_arg_conv; - channel_type_arg_conv.inner = (void*)(channel_type_arg & (~1)); - channel_type_arg_conv.is_owned = (channel_type_arg & 1) || (channel_type_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); - channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); - void* short_channel_id_arg_ptr = (void*)(((uintptr_t)short_channel_id_arg) & ~1); - CHECK_ACCESS(short_channel_id_arg_ptr); - LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); - short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_arg) & ~1)); - void* inbound_scid_alias_arg_ptr = (void*)(((uintptr_t)inbound_scid_alias_arg) & ~1); - CHECK_ACCESS(inbound_scid_alias_arg_ptr); - LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr); - inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)inbound_scid_alias_arg) & ~1)); - void* unspendable_punishment_reserve_arg_ptr = (void*)(((uintptr_t)unspendable_punishment_reserve_arg) & ~1); - CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); - LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); - void* confirmations_required_arg_ptr = (void*)(((uintptr_t)confirmations_required_arg) & ~1); - CHECK_ACCESS(confirmations_required_arg_ptr); - LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr); - confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)confirmations_required_arg) & ~1)); - void* force_close_spend_delay_arg_ptr = (void*)(((uintptr_t)force_close_spend_delay_arg) & ~1); - CHECK_ACCESS(force_close_spend_delay_arg_ptr); - LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); - force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)force_close_spend_delay_arg) & ~1)); - LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, channel_type_arg_conv, short_channel_id_arg_conv, inbound_scid_alias_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); + LDKStr data_arg_conv = java_to_owned_str(env, data_arg); + LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28633,8 +30959,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv return ret_ref; } -static inline uintptr_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { - LDKChannelDetails ret_var = ChannelDetails_clone(arg); +static inline uintptr_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { + LDKErrorMessage ret_var = ErrorMessage_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28645,21 +30971,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelDetails arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorMessage arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); + int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelDetails orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKErrorMessage orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); + LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28671,252 +30997,154 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEn return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelDetails this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKWarningMessage this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + WarningMessage_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); - FREE((void*)this_ptr); - PaymentSendFailure_free(this_ptr_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWarningMessage this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *WarningMessage_get_channel_id(&this_ptr_conv)); + return ret_arr; } -static inline uintptr_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - 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*)arg; - int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKWarningMessage this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + WarningMessage_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKWarningMessage this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) { - void* a_ptr = (void*)(((uintptr_t)a) & ~1); - CHECK_ACCESS(a_ptr); - LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); - a_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a) & ~1)); - LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_parameter_error(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKWarningMessage this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + WarningMessage_set_data(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) { - LDKCVec_CResult_NoneAPIErrorZZ a_constr; - a_constr.datalen = (*env)->GetArrayLength(env, a); - if (a_constr.datalen > 0) - a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); - else - a_constr.data = NULL; - int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL); - for (size_t w = 0; w < a_constr.datalen; w++) { - int64_t a_conv_22 = a_vals[w]; - void* a_conv_22_ptr = (void*)(((uintptr_t)a_conv_22) & ~1); - 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*)(((uintptr_t)a_conv_22) & ~1)); - a_constr.data[w] = a_conv_22_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKStr data_arg_conv = java_to_owned_str(env, data_arg); + LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - (*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 = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_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 = (void*)(((uintptr_t)a_conv_10) & ~1); - CHECK_ACCESS(a_conv_10_ptr); - LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); - a_conv_10_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a_conv_10) & ~1)); - 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_retry_safe(a_constr); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +static inline uintptr_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) { + LDKWarningMessage ret_var = WarningMessage_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -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 = (void*)(((uintptr_t)results_conv_22) & ~1); - CHECK_ACCESS(results_conv_22_ptr); - LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); - results_constr.data[w] = results_conv_22_conv; - } - (*env)->ReleaseLongArrayElements(env, results, results_vals, 0); - LDKRouteParameters failed_paths_retry_conv; - failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1)); - failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0); - 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 = (uintptr_t)ret_copy; return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPhantomRouteHints this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PhantomRouteHints_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKWarningMessage arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; - if (ret_conv_16_var.is_owned) { - ret_conv_16_ref |= 1; - } - ret_arr_ptr[q] = ret_conv_16_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKWarningMessage orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_ChannelDetailsZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t q = 0; q < val_constr.datalen; q++) { - int64_t val_conv_16 = val_vals[q]; - LDKChannelDetails val_conv_16_conv; - val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); - val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); - val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv); - val_constr.data[q] = val_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPing this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Ping_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); + int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKPhantomRouteHints this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); + Ping_set_ponglen(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; + int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKPhantomRouteHints this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); + Ping_set_byteslen(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { - LDKCVec_ChannelDetailsZ channels_arg_constr; - channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg); - if (channels_arg_constr.datalen > 0) - channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL); - for (size_t q = 0; q < channels_arg_constr.datalen; q++) { - int64_t channels_arg_conv_16 = channels_arg_vals[q]; - LDKChannelDetails channels_arg_conv_16_conv; - channels_arg_conv_16_conv.inner = (void*)(channels_arg_conv_16 & (~1)); - channels_arg_conv_16_conv.is_owned = (channels_arg_conv_16 & 1) || (channels_arg_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); - channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); - channels_arg_constr.data[q] = channels_arg_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0); - LDKPublicKey real_node_pubkey_arg_ref; - CHECK((*env)->GetArrayLength(env, real_node_pubkey_arg) == 33); - (*env)->GetByteArrayRegion(env, real_node_pubkey_arg, 0, 33, real_node_pubkey_arg_ref.compressed_form); - LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) { + LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28928,8 +31156,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1new(JNIE return ret_ref; } -static inline uintptr_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg); +static inline uintptr_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { + LDKPing ret_var = Ping_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28940,21 +31168,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPhantomRouteHints arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPing arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv); + int64_t ret_conv = Ping_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPhantomRouteHints orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPing orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv); + LDKPing ret_var = Ping_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -28966,53 +31194,33 @@ 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 logger, int64_t keys_manager, int64_t config, int64_t params) { - void* fee_est_ptr = (void*)(((uintptr_t)fee_est) & ~1); - CHECK_ACCESS(fee_est_ptr); - LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); - if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_est_conv); - } - void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); - CHECK_ACCESS(keys_manager_ptr); - LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); - if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKeysInterface_JCalls_cloned(&keys_manager_conv); - } - LDKUserConfig config_conv; - config_conv.inner = (void*)(config & (~1)); - config_conv.is_owned = (config & 1) || (config == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv = UserConfig_clone(&config_conv); - LDKChainParameters params_conv; - params_conv.inner = (void*)(params & (~1)); - params_conv.is_owned = (params & 1) || (params == 0); - 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, logger_conv, keys_manager_conv, config_conv, params_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPong this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Pong_free(this_obj_conv); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPong this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKPong this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + Pong_set_byteslen(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) { + LDKPong ret_var = Pong_new(byteslen_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -29024,12 +31232,33 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1current_1default_1configuration(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); +static inline uintptr_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { + LDKPong ret_var = Pong_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPong arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = Pong_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPong orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKPong ret_var = Pong_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -29041,969 +31270,730 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1curren return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int64_t user_channel_id, int64_t override_config) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKPublicKey their_network_key_ref; - CHECK((*env)->GetArrayLength(env, their_network_key) == 33); - (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form); - LDKUserConfig override_config_conv; - override_config_conv.inner = (void*)(override_config & (~1)); - override_config_conv.is_owned = (override_config & 1) || (override_config == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); - override_config_conv = UserConfig_clone(&override_config_conv); - LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); - *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOpenChannel this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OpenChannel_free(this_obj_conv); } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; - if (ret_conv_16_var.is_owned) { - ret_conv_16_ref |= 1; - } - ret_arr_ptr[q] = ret_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; - if (ret_conv_16_var.is_owned) { - ret_conv_16_ref |= 1; - } - ret_arr_ptr[q] = ret_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + OpenChannel_set_chain_hash(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, channel_id) == 32); - (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); - unsigned char (*channel_id_ref)[32] = &channel_id_arr; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel_1with_1target_1feerate(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id, int32_t target_feerate_sats_per_1000_weight) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, channel_id) == 32); - (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); - unsigned char (*channel_id_ref)[32] = &channel_id_arr; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, target_feerate_sats_per_1000_weight); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, channel_id) == 32); - (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); - unsigned char (*channel_id_ref)[32] = &channel_id_arr; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_channel(&this_arg_conv, channel_id_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_funding_satoshis(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - ChannelManager_force_close_all_channels(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKRoute route_conv; - route_conv.inner = (void*)(route & (~1)); - route_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_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_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_push_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKRoute route_conv; - route_conv.inner = (void*)(route & (~1)); - route_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_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_retry_payment(&this_arg_conv, &route_conv, payment_id_ref); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); + return ret_conv; } -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 = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - 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); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKRoute route_conv; - route_conv.inner = (void*)(route & (~1)); - route_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); - LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray funding_transaction) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char temporary_channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); - (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); - unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; - LDKTransaction funding_transaction_ref; - funding_transaction_ref.datalen = (*env)->GetArrayLength(env, funding_transaction); - funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data); - funding_transaction_ref.data_is_owned = true; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, funding_transaction_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray rgb, int8_tArray alias, int64_tArray addresses) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKThreeBytes rgb_ref; - CHECK((*env)->GetArrayLength(env, rgb) == 3); - (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data); - LDKThirtyTwoBytes alias_ref; - CHECK((*env)->GetArrayLength(env, alias) == 32); - (*env)->GetByteArrayRegion(env, alias, 0, 32, alias_ref.data); - LDKCVec_NetAddressZ addresses_constr; - addresses_constr.datalen = (*env)->GetArrayLength(env, addresses); - if (addresses_constr.datalen > 0) - addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); - else - addresses_constr.data = NULL; - int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL); - for (size_t m = 0; m < addresses_constr.datalen; m++) { - int64_t addresses_conv_12 = addresses_vals[m]; - void* addresses_conv_12_ptr = (void*)(((uintptr_t)addresses_conv_12) & ~1); - CHECK_ACCESS(addresses_conv_12_ptr); - LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr); - addresses_constr.data[m] = addresses_conv_12_conv; - } - (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0); - ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - ChannelManager_process_pending_htlc_forwards(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - ChannelManager_timer_tick_occurred(&this_arg_conv); +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char payment_hash_arr[32]; - CHECK((*env)->GetArrayLength(env, payment_hash) == 32); - (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); - unsigned char (*payment_hash_ref)[32] = &payment_hash_arr; - jboolean ret_conv = ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_preimage) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); - jboolean ret_conv = ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int64_t user_channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char temporary_channel_id_arr[32]; - CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); - (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); - unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, user_channel_id); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -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) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); - LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); - *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); - LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); - LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); - *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); - LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); - *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_payment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChannelManager_as_Listen(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update_1timeout(JNIEnv *env, jclass clz, int64_t this_arg, int64_t max_wait) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - ChannelManager_await_persistable_update(&this_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + OpenChannel_set_channel_flags(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv); int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); - *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCounterpartyForwardingInfo obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelTypeFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTypeFeatures_clone(&val_conv); + OpenChannel_set_channel_type(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_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_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CounterpartyForwardingInfo_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +static inline uintptr_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { + LDKOpenChannel ret_var = OpenChannel_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelCounterparty obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_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_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = ChannelCounterparty_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOpenChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelDetails obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOpenChannel orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_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_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = ChannelDetails_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKAcceptChannel this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + AcceptChannel_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPhantomRouteHints obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_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_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = PhantomRouteHints_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelManager obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelManagerReadArgs this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelManagerReadArgs_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; - return ret_ret; + int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); - if (val_conv.free == LDKKeysInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKeysInterface_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv); + AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; - return ret_ret; + int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); - if (val_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); + AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; - return ret_ret; + int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKWatch val_conv = *(LDKWatch*)(val_ptr); - if (val_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); + AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; - return ret_ret; + int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); - if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); + AcceptChannel_set_minimum_depth(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; - return ret_ret; + int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKLogger val_conv = *(LDKLogger*)(val_ptr); - if (val_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); + AcceptChannel_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUserConfig val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UserConfig_clone(&val_conv); - ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); + AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t default_config, int64_tArray channel_monitors) { - void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); - CHECK_ACCESS(keys_manager_ptr); - LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); - if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKeysInterface_JCalls_cloned(&keys_manager_conv); - } - void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); - CHECK_ACCESS(fee_estimator_ptr); - LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv); - } - void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv); - } - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - 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); - } - LDKUserConfig default_config_conv; - default_config_conv.inner = (void*)(default_config & (~1)); - default_config_conv.is_owned = (default_config & 1) || (default_config == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); - default_config_conv = UserConfig_clone(&default_config_conv); - LDKCVec_ChannelMonitorZ channel_monitors_constr; - channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors); - if (channel_monitors_constr.datalen > 0) - channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); - else - channel_monitors_constr.data = NULL; - int64_t* channel_monitors_vals = (*env)->GetLongArrayElements (env, channel_monitors, NULL); - for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { - int64_t channel_monitors_conv_16 = channel_monitors_vals[q]; - LDKChannelMonitor channel_monitors_conv_16_conv; - channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1)); - channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); - channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0); - LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_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); - LDKChannelManagerReadArgs arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = (arg & 1) || (arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs - LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); - *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDecodeError this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DecodeError_free(this_obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -static inline uintptr_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { - LDKDecodeError ret_var = DecodeError_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); } - return ret_ref; + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDecodeError arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = DecodeError_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_payment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDecodeError orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKDecodeError ret_var = DecodeError_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInit this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Init_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInit this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInit this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKInitFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = InitFeatures_clone(&val_conv); - Init_set_features(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKInit this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = Init_get_remote_network_address(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKInit this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr); - val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)(((uintptr_t)val) & ~1)); - Init_set_remote_network_address(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jclass clz, int64_t features_arg, int64_t remote_network_address_arg) { - LDKInitFeatures features_arg_conv; - features_arg_conv.inner = (void*)(features_arg & (~1)); - features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); - features_arg_conv = InitFeatures_clone(&features_arg_conv); - void* remote_network_address_arg_ptr = (void*)(((uintptr_t)remote_network_address_arg) & ~1); - CHECK_ACCESS(remote_network_address_arg_ptr); - LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr); - LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv); int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } } return ret_ref; } -static inline uintptr_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { - LDKInit ret_var = Init_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelTypeFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelTypeFeatures_clone(&val_conv); + AcceptChannel_set_channel_type(&this_ptr_conv, val_conv); +} + +static inline uintptr_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { + LDKAcceptChannel ret_var = AcceptChannel_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30014,21 +32004,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInit arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAcceptChannel arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Init_clone_ptr(&arg_conv); + int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInit orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAcceptChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKInit ret_var = Init_clone(&orig_conv); + LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30040,61 +32030,105 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKErrorMessage this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFundingCreated this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErrorMessage_free(this_obj_conv); + FundingCreated_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErrorMessage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKErrorMessage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingCreated this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingCreated this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ErrorMessage_set_channel_id(&this_ptr_conv, val_ref); + FundingCreated_set_funding_output_index(&this_ptr_conv, val); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKErrorMessage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKErrorMessage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - ErrorMessage_set_data(&this_ptr_conv, val_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + FundingCreated_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKStr data_arg_conv = java_to_owned_str(env, data_arg); - LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { + LDKThirtyTwoBytes temporary_channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, temporary_channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data); + LDKThirtyTwoBytes funding_txid_arg_ref; + CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32); + (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data); + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30106,8 +32140,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e return ret_ref; } -static inline uintptr_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { - LDKErrorMessage ret_var = ErrorMessage_clone(arg); +static inline uintptr_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { + LDKFundingCreated ret_var = FundingCreated_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30118,21 +32152,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKErrorMessage arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingCreated arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv); + int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKErrorMessage orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFundingCreated orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); + LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30144,61 +32178,64 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKWarningMessage this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFundingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - WarningMessage_free(this_obj_conv); + FundingSigned_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWarningMessage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *WarningMessage_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKWarningMessage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - WarningMessage_set_channel_id(&this_ptr_conv, val_ref); + FundingSigned_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKWarningMessage this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKWarningMessage this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - WarningMessage_set_data(&this_ptr_conv, val_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + FundingSigned_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKStr data_arg_conv = java_to_owned_str(env, data_arg); - LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv); + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30210,8 +32247,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv return ret_ref; } -static inline uintptr_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) { - LDKWarningMessage ret_var = WarningMessage_clone(arg); +static inline uintptr_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { + LDKFundingSigned ret_var = FundingSigned_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30222,21 +32259,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKWarningMessage arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv); + int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKWarningMessage orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFundingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv); + LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30248,50 +32285,91 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEn return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPing this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelReady this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Ping_free(this_obj_conv); + ChannelReady_free(this_obj_conv); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPing this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReady_get_channel_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKPing this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - Ping_set_ponglen(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelReady_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPing this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKPing this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelReady this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - Ping_set_byteslen(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) { - LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReady this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelReady this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); + ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_t short_channel_id_alias_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKPublicKey next_per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form); + void* short_channel_id_alias_arg_ptr = (void*)(((uintptr_t)short_channel_id_alias_arg) & ~1); + CHECK_ACCESS(short_channel_id_alias_arg_ptr); + LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr); + short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_alias_arg) & ~1)); + LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30303,8 +32381,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla return ret_ref; } -static inline uintptr_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { - LDKPing ret_var = Ping_clone(arg); +static inline uintptr_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) { + LDKChannelReady ret_var = ChannelReady_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30315,21 +32393,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPing arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelReady arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Ping_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPing orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelReady orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKPing ret_var = Ping_clone(&orig_conv); + LDKChannelReady ret_var = ChannelReady_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30341,33 +32419,67 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPong this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKShutdown this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Pong_free(this_obj_conv); + Shutdown_free(this_obj_conv); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPong this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKPong this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - Pong_set_byteslen(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + Shutdown_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) { - LDKPong ret_var = Pong_new(byteslen_arg); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKShutdown this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKu8slice ret_var = Shutdown_get_scriptpubkey(&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); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKShutdown this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_u8Z val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKCVec_u8Z scriptpubkey_arg_ref; + scriptpubkey_arg_ref.datalen = (*env)->GetArrayLength(env, scriptpubkey_arg); + scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data); + LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30379,8 +32491,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla return ret_ref; } -static inline uintptr_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { - LDKPong ret_var = Pong_clone(arg); +static inline uintptr_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { + LDKShutdown ret_var = Shutdown_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30391,21 +32503,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPong arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdown arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Pong_clone_ptr(&arg_conv); + int64_t ret_conv = Shutdown_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPong orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKShutdown orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKPong ret_var = Pong_clone(&orig_conv); + LDKShutdown ret_var = Shutdown_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30417,358 +32529,172 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKOpenChannel this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKClosingSignedFeeRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OpenChannel_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - OpenChannel_set_chain_hash(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_funding_satoshis(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_push_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_to_self_delay(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); + ClosingSignedFeeRange_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_payment_point(&this_ptr_conv, val_ref); + ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); + ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new(JNIEnv *env, jclass clz, int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) { + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSignedFeeRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClosingSignedFeeRange orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKClosingSigned this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ClosingSigned_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ClosingSigned_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); + ClosingSigned_set_fee_satoshis(&this_ptr_conv, val); } -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - OpenChannel_set_channel_flags(&this_ptr_conv, val); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ClosingSigned_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv); + LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); int64_t ret_ref = 0; if ((uintptr_t)ret_var.inner > 4096) { CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -30782,21 +32708,45 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1 return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures val_conv; + LDKClosingSignedFeeRange val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - OpenChannel_set_channel_type(&this_ptr_conv, val_conv); + val_conv = ClosingSignedFeeRange_clone(&val_conv); + ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } -static inline uintptr_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { - LDKOpenChannel ret_var = OpenChannel_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_t fee_range_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKClosingSignedFeeRange fee_range_arg_conv; + fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); + fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); + fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); + LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { + LDKClosingSigned ret_var = ClosingSigned_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30807,21 +32757,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKOpenChannel arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv); + int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKOpenChannel orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClosingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); + LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -30833,314 +32783,317 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv * return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKAcceptChannel this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateAddHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - AcceptChannel_free(this_obj_conv); + UpdateAddHTLC_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); + UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); + int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); + UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); + UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); + int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); + UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv); - return ret_conv; +static inline uintptr_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_minimum_depth(&this_ptr_conv, val); + return ret_ref; } - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateAddHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_to_self_delay(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateAddHTLC orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFulfillHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UpdateFulfillHTLC_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; + int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); + UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_payment_point(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_arg) { + LDKThirtyTwoBytes channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); + (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKThirtyTwoBytes payment_preimage_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data); + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); +static inline uintptr_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFulfillHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateFulfillHTLC orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFailHTLC this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + UpdateFailHTLC_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv); - int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - } - return ret_ref; + int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelTypeFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelTypeFeatures_clone(&val_conv); - AcceptChannel_set_channel_type(&this_ptr_conv, val_conv); + UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val); } -static inline uintptr_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { - LDKAcceptChannel ret_var = AcceptChannel_clone(arg); +static inline uintptr_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31151,21 +33104,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAcceptChannel arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv); + int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAcceptChannel orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateFailHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31177,118 +33130,71 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFundingCreated this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFailMalformedHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FundingCreated_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv)); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingCreated this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref); + UpdateFailMalformedHTLC_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); + UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv); + int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - FundingCreated_set_funding_output_index(&this_ptr_conv, val); + UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form); - return ret_arr; + int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingCreated this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - FundingCreated_set_signature(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, temporary_channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data); - LDKThirtyTwoBytes funding_txid_arg_ref; - CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32); - (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data); - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val); } -static inline uintptr_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { - LDKFundingCreated ret_var = FundingCreated_clone(arg); +static inline uintptr_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31299,21 +33205,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFundingCreated arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailMalformedHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv); + int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFundingCreated orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateFailMalformedHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31325,64 +33231,98 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEn return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFundingSigned this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FundingSigned_free(this_obj_conv); + CommitmentSigned_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - FundingSigned_set_channel_id(&this_ptr_conv, val_ref); + CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - FundingSigned_set_signature(&this_ptr_conv, val_ref); + CommitmentSigned_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { + LDKCommitmentSigned this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_SignatureZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + val_constr.data = NULL; + for (size_t i = 0; i < val_constr.datalen; i++) { + int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); + LDKSignature val_conv_8_ref; + CHECK((*env)->GetArrayLength(env, val_conv_8) == 64); + (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form); + val_constr.data[i] = val_conv_8_ref; + } + CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg, jobjectArray htlc_signatures_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); LDKSignature signature_arg_ref; CHECK((*env)->GetArrayLength(env, signature_arg) == 64); (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref); + LDKCVec_SignatureZ htlc_signatures_arg_constr; + htlc_signatures_arg_constr.datalen = (*env)->GetArrayLength(env, htlc_signatures_arg); + if (htlc_signatures_arg_constr.datalen > 0) + htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + htlc_signatures_arg_constr.data = NULL; + for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) { + int8_tArray htlc_signatures_arg_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i); + LDKSignature htlc_signatures_arg_conv_8_ref; + CHECK((*env)->GetArrayLength(env, htlc_signatures_arg_conv_8) == 64); + (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form); + htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref; + } + LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31394,8 +33334,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * return ret_ref; } -static inline uintptr_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { - LDKFundingSigned ret_var = FundingSigned_clone(arg); +static inline uintptr_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { + LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31406,21 +33346,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFundingSigned arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv); + int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFundingSigned orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCommitmentSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); + LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31432,91 +33372,88 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFundingLocked this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRevokeAndACK this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FundingLocked_free(this_obj_conv); + RevokeAndACK_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingLocked_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - FundingLocked_set_channel_id(&this_ptr_conv, val_ref); + RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - FundingLocked_set_next_per_commitment_point(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = FundingLocked_get_short_channel_id_alias(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKFundingLocked this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); - FundingLocked_set_short_channel_id_alias(&this_ptr_conv, val_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_t short_channel_id_alias_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); + LDKThirtyTwoBytes per_commitment_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data); LDKPublicKey next_per_commitment_point_arg_ref; CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33); (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form); - void* short_channel_id_alias_arg_ptr = (void*)(((uintptr_t)short_channel_id_alias_arg) & ~1); - CHECK_ACCESS(short_channel_id_alias_arg_ptr); - LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr); - short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_alias_arg) & ~1)); - LDKFundingLocked ret_var = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv); + LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31528,8 +33465,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * return ret_ref; } -static inline uintptr_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) { - LDKFundingLocked ret_var = FundingLocked_clone(arg); +static inline uintptr_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { + LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31540,21 +33477,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFundingLocked arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRevokeAndACK arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = FundingLocked_clone_ptr(&arg_conv); + int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFundingLocked orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRevokeAndACK orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv); + LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31566,67 +33503,57 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKShutdown this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUpdateFee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Shutdown_free(this_obj_conv); + UpdateFee_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKShutdown this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKShutdown this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - Shutdown_set_channel_id(&this_ptr_conv, val_ref); + UpdateFee_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKShutdown this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKu8slice ret_var = Shutdown_get_scriptpubkey(&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); - return ret_arr; + int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKShutdown this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_u8Z val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); + UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKCVec_u8Z scriptpubkey_arg_ref; - scriptpubkey_arg_ref.datalen = (*env)->GetArrayLength(env, scriptpubkey_arg); - scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data); - LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref); + LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31638,8 +33565,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, return ret_ref; } -static inline uintptr_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { - LDKShutdown ret_var = Shutdown_clone(arg); +static inline uintptr_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { + LDKUpdateFee ret_var = UpdateFee_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31650,21 +33577,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKShutdown arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFee arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = Shutdown_clone_ptr(&arg_conv); + int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKShutdown orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUpdateFee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKShutdown ret_var = Shutdown_clone(&orig_conv); + LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31676,50 +33603,102 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKClosingSignedFeeRange this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDataLossProtect this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClosingSignedFeeRange_free(this_obj_conv); + DataLossProtect_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSignedFeeRange this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClosingSignedFeeRange this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSignedFeeRange this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClosingSignedFeeRange this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new(JNIEnv *env, jclass clz, int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) { - LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv *env, jclass clz, int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg) { + LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref; + CHECK((*env)->GetArrayLength(env, your_last_per_commitment_secret_arg) == 32); + (*env)->GetByteArrayRegion(env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data); + LDKPublicKey my_current_per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form); + LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { + LDKDataLossProtect ret_var = DataLossProtect_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDataLossProtect arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDataLossProtect orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31731,8 +33710,71 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new( return ret_ref; } -static inline uintptr_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { - LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelReestablish this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelReestablish_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv)); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelReestablish this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val); +} + +static inline uintptr_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { + LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31743,21 +33785,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClosingSignedFeeRange arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelReestablish arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClosingSignedFeeRange orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelReestablish orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); + LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31769,118 +33811,105 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clon return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKClosingSigned this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKAnnouncementSignatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClosingSigned_free(this_obj_conv); + AnnouncementSignatures_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ClosingSigned_set_channel_id(&this_ptr_conv, val_ref); + AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv); + int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ClosingSigned_set_fee_satoshis(&this_ptr_conv, val); + AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ClosingSigned_set_signature(&this_ptr_conv, val_ref); + AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); - int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - } - return ret_ref; + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKClosingSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKClosingSignedFeeRange val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ClosingSignedFeeRange_clone(&val_conv); - ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_t fee_range_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKClosingSignedFeeRange fee_range_arg_conv; - fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); - fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); - fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); - LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); + LDKSignature node_signature_arg_ref; + CHECK((*env)->GetArrayLength(env, node_signature_arg) == 64); + (*env)->GetByteArrayRegion(env, node_signature_arg, 0, 64, node_signature_arg_ref.compact_form); + LDKSignature bitcoin_signature_arg_ref; + CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64); + (*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form); + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31892,8 +33921,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * return ret_ref; } -static inline uintptr_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { - LDKClosingSigned ret_var = ClosingSigned_clone(arg); +static inline uintptr_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31904,21 +33933,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClosingSigned arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAnnouncementSignatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv); + int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClosingSigned orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKAnnouncementSignatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -31930,109 +33959,238 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateAddHTLC this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr); + FREE((void*)this_ptr); + NetAddress_free(this_ptr_conv); +} + +static inline uintptr_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetAddress* arg_conv = (LDKNetAddress*)arg; + int64_t ret_conv = NetAddress_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNetAddress* orig_conv = (LDKNetAddress*)orig; + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) { + LDKFourBytes addr_ref; + CHECK((*env)->GetArrayLength(env, addr) == 4); + (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data); + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_ipv4(addr_ref, port); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) { + LDKSixteenBytes addr_ref; + CHECK((*env)->GetArrayLength(env, addr) == 16); + (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data); + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_ipv6(addr_ref, port); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) { + LDKTwelveBytes a_ref; + CHECK((*env)->GetArrayLength(env, a) == 12); + (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data); + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_onion_v2(a_ref); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v3(JNIEnv *env, jclass clz, int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) { + LDKThirtyTwoBytes ed25519_pubkey_ref; + CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32); + (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data); + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNetAddress* obj_conv = (LDKNetAddress*)obj; + LDKCVec_u8Z ret_var = NetAddress_write(obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_NetAddress_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_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = NetAddress_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateAddHTLC_free(this_obj_conv); + UnsignedNodeAnnouncement_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv)); - return ret_arr; + LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKNodeFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = NodeFeatures_clone(&val_conv); + UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv); + int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val); + UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 3); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref); + LDKThreeBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 3); + (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); + UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv)); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUpdateAddHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref); } -static inline uintptr_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { - LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKUnsignedNodeAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_NetAddressZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t m = 0; m < val_constr.datalen; m++) { + int64_t val_conv_12 = val_vals[m]; + void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1); + CHECK_ACCESS(val_conv_12_ptr); + LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr); + val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1)); + val_constr.data[m] = val_conv_12_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); +} + +static inline uintptr_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32043,21 +34201,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateAddHTLC arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedNodeAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv); + int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateAddHTLC orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32069,81 +34227,75 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateFulfillHTLC this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateFulfillHTLC_free(this_obj_conv); + NodeAnnouncement_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFulfillHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFulfillHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFulfillHTLC this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateFulfillHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + NodeAnnouncement_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFulfillHTLC this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv)); - return ret_arr; + LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFulfillHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); + LDKUnsignedNodeAnnouncement val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UnsignedNodeAnnouncement_clone(&val_conv); + NodeAnnouncement_set_contents(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKThirtyTwoBytes payment_preimage_arg_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data); - LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) { + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKUnsignedNodeAnnouncement contents_arg_conv; + contents_arg_conv.inner = (void*)(contents_arg & (~1)); + contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); + contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); + LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32155,8 +34307,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE return ret_ref; } -static inline uintptr_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { - LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); +static inline uintptr_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { + LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32167,21 +34319,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateFulfillHTLC arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv); + int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateFulfillHTLC orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); + LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32193,155 +34345,168 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JN return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateFailHTLC this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateFailHTLC_free(this_obj_conv); + UnsignedChannelAnnouncement_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailHTLC this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelFeatures val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelFeatures_clone(&val_conv); + UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFailHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref); + UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailHTLC this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv); + int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateFailHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val); -} - -static inline uintptr_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { - LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateFailHTLC arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv); - return ret_conv; + UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateFailHTLC orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateFailMalformedHTLC this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateFailMalformedHTLC_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKUpdateFailMalformedHTLC this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); } -static inline uintptr_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { - LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); +static inline uintptr_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { + LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32352,21 +34517,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateFailMalformedHTLC arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); + int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateFailMalformedHTLC orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); + LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32378,98 +34543,147 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1cl return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCommitmentSigned this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CommitmentSigned_free(this_obj_conv); + ChannelAnnouncement_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - CommitmentSigned_set_signature(&this_ptr_conv, val_ref); + ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { - LDKCommitmentSigned this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_SignatureZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - val_constr.data = NULL; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); - LDKSignature val_conv_8_ref; - CHECK((*env)->GetArrayLength(env, val_conv_8) == 64); - (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form); - val_constr.data[i] = val_conv_8_ref; - } - CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form); + return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg, jobjectArray htlc_signatures_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKCVec_SignatureZ htlc_signatures_arg_constr; - htlc_signatures_arg_constr.datalen = (*env)->GetArrayLength(env, htlc_signatures_arg); - if (htlc_signatures_arg_constr.datalen > 0) - htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - htlc_signatures_arg_constr.data = NULL; - for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) { - int8_tArray htlc_signatures_arg_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i); - LDKSignature htlc_signatures_arg_conv_8_ref; - CHECK((*env)->GetArrayLength(env, htlc_signatures_arg_conv_8) == 64); - (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form); - htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelAnnouncement this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKUnsignedChannelAnnouncement val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UnsignedChannelAnnouncement_clone(&val_conv); + ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray node_signature_1_arg, int8_tArray node_signature_2_arg, int8_tArray bitcoin_signature_1_arg, int8_tArray bitcoin_signature_2_arg, int64_t contents_arg) { + LDKSignature node_signature_1_arg_ref; + CHECK((*env)->GetArrayLength(env, node_signature_1_arg) == 64); + (*env)->GetByteArrayRegion(env, node_signature_1_arg, 0, 64, node_signature_1_arg_ref.compact_form); + LDKSignature node_signature_2_arg_ref; + CHECK((*env)->GetArrayLength(env, node_signature_2_arg) == 64); + (*env)->GetByteArrayRegion(env, node_signature_2_arg, 0, 64, node_signature_2_arg_ref.compact_form); + LDKSignature bitcoin_signature_1_arg_ref; + CHECK((*env)->GetArrayLength(env, bitcoin_signature_1_arg) == 64); + (*env)->GetByteArrayRegion(env, bitcoin_signature_1_arg, 0, 64, bitcoin_signature_1_arg_ref.compact_form); + LDKSignature bitcoin_signature_2_arg_ref; + CHECK((*env)->GetArrayLength(env, bitcoin_signature_2_arg) == 64); + (*env)->GetByteArrayRegion(env, bitcoin_signature_2_arg, 0, 64, bitcoin_signature_2_arg_ref.compact_form); + LDKUnsignedChannelAnnouncement contents_arg_conv; + contents_arg_conv.inner = (void*)(contents_arg & (~1)); + contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); + contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); + LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32481,8 +34695,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn return ret_ref; } -static inline uintptr_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { - LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); +static inline uintptr_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { + LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32493,21 +34707,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCommitmentSigned arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCommitmentSigned orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); + LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32519,201 +34733,168 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRevokeAndACK this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKUnsignedChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RevokeAndACK_free(this_obj_conv); + UnsignedChannelUpdate_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref); + UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv)); - return ret_arr; + int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref); + UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKRevokeAndACK this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); + UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKThirtyTwoBytes per_commitment_secret_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_secret_arg) == 32); - (*env)->GetByteArrayRegion(env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data); - LDKPublicKey next_per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form); - LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); + return ret_conv; } -static inline uintptr_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { - LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRevokeAndACK arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv); + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRevokeAndACK orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUpdateFee this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UpdateFee_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFee this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv)); - return ret_arr; + UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUpdateFee this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UpdateFee_set_channel_id(&this_ptr_conv, val_ref); + int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUpdateFee this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv); + UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUpdateFee this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKUnsignedChannelUpdate this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + 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); + UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref); } -static inline uintptr_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { - LDKUpdateFee ret_var = UpdateFee_clone(arg); +static inline uintptr_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32724,21 +34905,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUpdateFee arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv); + int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUpdateFee orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKUnsignedChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32750,64 +34931,75 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *en return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDataLossProtect this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DataLossProtect_free(this_obj_conv); + ChannelUpdate_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDataLossProtect this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv)); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDataLossProtect this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + ChannelUpdate_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKDataLossProtect this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; + LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKDataLossProtect this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref); + LDKUnsignedChannelUpdate val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UnsignedChannelUpdate_clone(&val_conv); + ChannelUpdate_set_contents(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv *env, jclass clz, int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg) { - LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref; - CHECK((*env)->GetArrayLength(env, your_last_per_commitment_secret_arg) == 32); - (*env)->GetByteArrayRegion(env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data); - LDKPublicKey my_current_per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form); - LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) { + LDKSignature signature_arg_ref; + CHECK((*env)->GetArrayLength(env, signature_arg) == 64); + (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); + LDKUnsignedChannelUpdate contents_arg_conv; + contents_arg_conv.inner = (void*)(contents_arg & (~1)); + contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); + contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); + LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32819,8 +35011,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv return ret_ref; } -static inline uintptr_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { - LDKDataLossProtect ret_var = DataLossProtect_clone(arg); +static inline uintptr_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { + LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32831,21 +35023,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKDataLossProtect arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKDataLossProtect orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); + LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32857,71 +35049,87 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelReestablish this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKQueryChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelReestablish_free(this_obj_conv); + QueryChannelRange_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref); + QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv); + int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val); + QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv); + int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelReestablish this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val); + QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); } -static inline uintptr_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { - LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { + LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32932,21 +35140,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelReestablish arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryChannelRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv); + int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelReestablish orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKQueryChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); + LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -32958,105 +35166,123 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(J return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKAnnouncementSignatures this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReplyChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - AnnouncementSignatures_free(this_obj_conv); + ReplyChannelRange_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref); + ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv); + int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val); + ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form); - return ret_arr; + int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref); + ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form); - return ret_arr; + jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKAnnouncementSignatures this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); + ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_arg) { - LDKThirtyTwoBytes channel_id_arg_ref; - CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32); - (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data); - LDKSignature node_signature_arg_ref; - CHECK((*env)->GetArrayLength(env, node_signature_arg) == 64); - (*env)->GetByteArrayRegion(env, node_signature_arg, 0, 64, node_signature_arg_ref.compact_form); - LDKSignature bitcoin_signature_arg_ref; - CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64); - (*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form); - LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKReplyChannelRange this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_u64Z val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg, jboolean sync_complete_arg, int64_tArray short_channel_ids_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKCVec_u64Z short_channel_ids_arg_constr; + short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg); + if (short_channel_ids_arg_constr.datalen > 0) + short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + short_channel_ids_arg_constr.data = NULL; + int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL); + for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { + int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g]; + short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6; + } + (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0); + LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33068,8 +35294,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new return ret_ref; } -static inline uintptr_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { - LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); +static inline uintptr_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { + LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33080,264 +35306,111 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKAnnouncementSignatures arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyChannelRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv); + int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKAnnouncementSignatures orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReplyChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr); - FREE((void*)this_ptr); - NetAddress_free(this_ptr_conv); -} - -static inline uintptr_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNetAddress* arg_conv = (LDKNetAddress*)arg; - int64_t ret_conv = NetAddress_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNetAddress* orig_conv = (LDKNetAddress*)orig; - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) { - LDKFourBytes addr_ref; - CHECK((*env)->GetArrayLength(env, addr) == 4); - (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data); - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_ipv4(addr_ref, port); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) { - LDKSixteenBytes addr_ref; - CHECK((*env)->GetArrayLength(env, addr) == 16); - (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data); - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_ipv6(addr_ref, port); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) { - LDKTwelveBytes a_ref; - CHECK((*env)->GetArrayLength(env, a) == 12); - (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data); - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_onion_v2(a_ref); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v3(JNIEnv *env, jclass clz, int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) { - LDKThirtyTwoBytes ed25519_pubkey_ref; - CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32); - (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data); - LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); - *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNetAddress* obj_conv = (LDKNetAddress*)obj; - LDKCVec_u8Z ret_var = NetAddress_write(obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_NetAddress_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_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); - *ret_conv = NetAddress_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedNodeAnnouncement this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedNodeAnnouncement_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); + LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKNodeFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = NodeFeatures_clone(&val_conv); - UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 3); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv)); - return ret_arr; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThreeBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 3); - (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); - UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKQueryShortChannelIds this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + QueryShortChannelIds_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedNodeAnnouncement this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref); + QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKUnsignedNodeAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_NetAddressZ val_constr; + LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); + val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else val_constr.data = NULL; int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t m = 0; m < val_constr.datalen; m++) { - int64_t val_conv_12 = val_vals[m]; - void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1); - CHECK_ACCESS(val_conv_12_ptr); - LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr); - val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1)); - val_constr.data[m] = val_conv_12_conv; + for (size_t g = 0; g < val_constr.datalen; g++) { + int64_t val_conv_6 = val_vals[g]; + val_constr.data[g] = val_conv_6; } (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); + QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr); } -static inline uintptr_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { - LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKCVec_u64Z short_channel_ids_arg_constr; + short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg); + if (short_channel_ids_arg_constr.datalen > 0) + short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); + else + short_channel_ids_arg_constr.data = NULL; + int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL); + for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { + int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g]; + short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6; + } + (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0); + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33348,21 +35421,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedNodeAnnouncement arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryShortChannelIds arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); + int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedNodeAnnouncement orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKQueryShortChannelIds orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33374,75 +35447,57 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1c return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeAnnouncement this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKReplyShortChannelIdsEnd this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeAnnouncement_free(this_obj_conv); + ReplyShortChannelIdsEnd_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncement this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKNodeAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - NodeAnnouncement_set_signature(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKNodeAnnouncement this_ptr_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKNodeAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedNodeAnnouncement val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UnsignedNodeAnnouncement_clone(&val_conv); - NodeAnnouncement_set_contents(&this_ptr_conv, val_conv); + ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) { - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKUnsignedNodeAnnouncement contents_arg_conv; - contents_arg_conv.inner = (void*)(contents_arg & (~1)); - contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); - contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); - LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, jboolean full_information_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33454,8 +35509,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn return ret_ref; } -static inline uintptr_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { - LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); +static inline uintptr_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33466,21 +35521,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeAnnouncement arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyShortChannelIdsEnd arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv); + int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeAnnouncement orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKReplyShortChannelIdsEnd orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33492,168 +35547,87 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedChannelAnnouncement this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKGossipTimestampFilter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedChannelAnnouncement_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelFeatures val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelFeatures_clone(&val_conv); - UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv); + GossipTimestampFilter_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref); + GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv); + int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form); - return ret_arr; + GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref); + int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form); - return ret_arr; + GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_timestamp_arg, int32_t timestamp_range_arg) { + LDKThirtyTwoBytes chain_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -static inline uintptr_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { - LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); +static inline uintptr_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33664,21 +35638,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedChannelAnnouncement arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKGossipTimestampFilter arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); + int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedChannelAnnouncement orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKGossipTimestampFilter orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33690,147 +35664,152 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelAnnouncement this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelAnnouncement_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr); + FREE((void*)this_ptr); + ErrorAction_free(this_ptr_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form); - return ret_arr; +static inline uintptr_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorAction* arg_conv = (LDKErrorAction*)arg; + int64_t ret_conv = ErrorAction_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKErrorAction* orig_conv = (LDKErrorAction*)orig; + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) { + LDKErrorMessage msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ErrorMessage_clone(&msg_conv); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_disconnect_peer(msg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_ignore_error(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) { + LDKLevel a_conv = LDKLevel_from_java(env, a); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_ignore_and_log(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelAnnouncement this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_ignore_duplicate_gossip(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) { + LDKErrorMessage msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = ErrorMessage_clone(&msg_conv); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_send_error_message(msg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1warning_1message(JNIEnv *env, jclass clz, int64_t msg, jclass log_level) { + LDKWarningMessage msg_conv; + msg_conv.inner = (void*)(msg & (~1)); + msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); + msg_conv = WarningMessage_clone(&msg_conv); + LDKLevel log_level_conv = LDKLevel_from_java(env, log_level); + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKLightningError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + LightningError_free(this_obj_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form); - return ret_arr; + LDKStr ret_str = LightningError_get_err(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref); + LDKStr val_conv = java_to_owned_str(env, val); + LightningError_set_err(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelAnnouncement this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = LightningError_get_action(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelAnnouncement this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedChannelAnnouncement val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UnsignedChannelAnnouncement_clone(&val_conv); - ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); + val_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)val) & ~1)); + LightningError_set_action(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray node_signature_1_arg, int8_tArray node_signature_2_arg, int8_tArray bitcoin_signature_1_arg, int8_tArray bitcoin_signature_2_arg, int64_t contents_arg) { - LDKSignature node_signature_1_arg_ref; - CHECK((*env)->GetArrayLength(env, node_signature_1_arg) == 64); - (*env)->GetByteArrayRegion(env, node_signature_1_arg, 0, 64, node_signature_1_arg_ref.compact_form); - LDKSignature node_signature_2_arg_ref; - CHECK((*env)->GetArrayLength(env, node_signature_2_arg) == 64); - (*env)->GetByteArrayRegion(env, node_signature_2_arg, 0, 64, node_signature_2_arg_ref.compact_form); - LDKSignature bitcoin_signature_1_arg_ref; - CHECK((*env)->GetArrayLength(env, bitcoin_signature_1_arg) == 64); - (*env)->GetByteArrayRegion(env, bitcoin_signature_1_arg, 0, 64, bitcoin_signature_1_arg_ref.compact_form); - LDKSignature bitcoin_signature_2_arg_ref; - CHECK((*env)->GetArrayLength(env, bitcoin_signature_2_arg) == 64); - (*env)->GetByteArrayRegion(env, bitcoin_signature_2_arg, 0, 64, bitcoin_signature_2_arg_ref.compact_form); - LDKUnsignedChannelAnnouncement contents_arg_conv; - contents_arg_conv.inner = (void*)(contents_arg & (~1)); - contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); - contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); - LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) { + LDKStr err_arg_conv = java_to_owned_str(env, err_arg); + void* action_arg_ptr = (void*)(((uintptr_t)action_arg) & ~1); + CHECK_ACCESS(action_arg_ptr); + LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr); + action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)action_arg) & ~1)); + LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33842,8 +35821,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN return ret_ref; } -static inline uintptr_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { - LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); +static inline uintptr_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { + LDKLightningError ret_var = LightningError_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33854,21 +35833,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelAnnouncement arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKLightningError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv); + int64_t ret_conv = LightningError_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelAnnouncement orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKLightningError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); + LDKLightningError ret_var = LightningError_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -33880,227 +35859,256 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone( return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKUnsignedChannelUpdate this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - UnsignedChannelUpdate_free(this_obj_conv); + CommitmentUpdate_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv)); + LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p]; + int64_t ret_conv_15_ref = 0; + CHECK((((uintptr_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); + ret_conv_15_ref = (uintptr_t)ret_conv_15_var.inner; + if (ret_conv_15_var.is_owned) { + ret_conv_15_ref |= 1; + } + ret_arr_ptr[p] = ret_conv_15_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); -} - -JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); - return ret_conv; + LDKCVec_UpdateAddHTLCZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t p = 0; p < val_constr.datalen; p++) { + int64_t val_conv_15 = val_vals[p]; + LDKUpdateAddHTLC val_conv_15_conv; + val_conv_15_conv.inner = (void*)(val_conv_15 & (~1)); + val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); + val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); + val_constr.data[p] = val_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); + LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t t = 0; t < ret_var.datalen; t++) { + LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t]; + int64_t ret_conv_19_ref = 0; + CHECK((((uintptr_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); + ret_conv_19_ref = (uintptr_t)ret_conv_19_var.inner; + if (ret_conv_19_var.is_owned) { + ret_conv_19_ref |= 1; + } + ret_arr_ptr[t] = ret_conv_19_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_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + LDKCVec_UpdateFulfillHTLCZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t t = 0; t < val_constr.datalen; t++) { + int64_t val_conv_19 = val_vals[t]; + LDKUpdateFulfillHTLC val_conv_19_conv; + val_conv_19_conv.inner = (void*)(val_conv_19 & (~1)); + val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); + val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); + val_constr.data[t] = val_conv_19_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); + LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t q = 0; q < ret_var.datalen; q++) { + LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; + if (ret_conv_16_var.is_owned) { + ret_conv_16_ref |= 1; + } + ret_arr_ptr[q] = ret_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); - return ret_conv; + LDKCVec_UpdateFailHTLCZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t q = 0; q < val_constr.datalen; q++) { + int64_t val_conv_16 = val_vals[q]; + LDKUpdateFailHTLC val_conv_16_conv; + val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); + val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); + val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); + val_constr.data[q] = val_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); + LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t z = 0; z < ret_var.datalen; z++) { + LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z]; + int64_t ret_conv_25_ref = 0; + CHECK((((uintptr_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); + ret_conv_25_ref = (uintptr_t)ret_conv_25_var.inner; + if (ret_conv_25_var.is_owned) { + ret_conv_25_ref |= 1; + } + ret_arr_ptr[z] = ret_conv_25_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + LDKCVec_UpdateFailMalformedHTLCZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); + else + val_constr.data = NULL; + int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); + for (size_t z = 0; z < val_constr.datalen; z++) { + int64_t val_conv_25 = val_vals[z]; + LDKUpdateFailMalformedHTLC val_conv_25_conv; + val_conv_25_conv.inner = (void*)(val_conv_25 & (~1)); + val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); + val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); + val_constr.data[z] = val_conv_25_conv; + } + (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); + CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKUnsignedChannelUpdate this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); -} - -static inline uintptr_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKUnsignedChannelUpdate arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKUnsignedChannelUpdate orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); + LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelUpdate this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelUpdate_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - ChannelUpdate_set_signature(&this_ptr_conv, val_ref); + LDKUpdateFee val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = UpdateFee_clone(&val_conv); + CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelUpdate this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); + LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34112,29 +36120,99 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1content return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUnsignedChannelUpdate val_conv; + LDKCommitmentSigned val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UnsignedChannelUpdate_clone(&val_conv); - ChannelUpdate_set_contents(&this_ptr_conv, val_conv); + val_conv = CommitmentSigned_clone(&val_conv); + CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) { - LDKSignature signature_arg_ref; - CHECK((*env)->GetArrayLength(env, signature_arg) == 64); - (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form); - LDKUnsignedChannelUpdate contents_arg_conv; - contents_arg_conv.inner = (void*)(contents_arg & (~1)); - contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); - contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); - LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEnv *env, jclass clz, int64_tArray update_add_htlcs_arg, int64_tArray update_fulfill_htlcs_arg, int64_tArray update_fail_htlcs_arg, int64_tArray update_fail_malformed_htlcs_arg, int64_t update_fee_arg, int64_t commitment_signed_arg) { + LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr; + update_add_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_add_htlcs_arg); + if (update_add_htlcs_arg_constr.datalen > 0) + update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); + else + update_add_htlcs_arg_constr.data = NULL; + int64_t* update_add_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_add_htlcs_arg, NULL); + for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { + int64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p]; + LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; + update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1)); + update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); + update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); + update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; + } + (*env)->ReleaseLongArrayElements(env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0); + LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr; + update_fulfill_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fulfill_htlcs_arg); + if (update_fulfill_htlcs_arg_constr.datalen > 0) + update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); + else + update_fulfill_htlcs_arg_constr.data = NULL; + int64_t* update_fulfill_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fulfill_htlcs_arg, NULL); + for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { + int64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t]; + LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; + update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1)); + update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); + update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); + update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; + } + (*env)->ReleaseLongArrayElements(env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0); + LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr; + update_fail_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_htlcs_arg); + if (update_fail_htlcs_arg_constr.datalen > 0) + update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); + else + update_fail_htlcs_arg_constr.data = NULL; + int64_t* update_fail_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_htlcs_arg, NULL); + for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { + int64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q]; + LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; + update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1)); + update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); + update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); + update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0); + LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr; + update_fail_malformed_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_malformed_htlcs_arg); + if (update_fail_malformed_htlcs_arg_constr.datalen > 0) + update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); + else + update_fail_malformed_htlcs_arg_constr.data = NULL; + int64_t* update_fail_malformed_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_malformed_htlcs_arg, NULL); + for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { + int64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; + LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; + update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1)); + update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); + update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); + update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; + } + (*env)->ReleaseLongArrayElements(env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0); + LDKUpdateFee update_fee_arg_conv; + update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); + update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); + update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); + LDKCommitmentSigned commitment_signed_arg_conv; + commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); + commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); + commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); + LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34146,8 +36224,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * return ret_ref; } -static inline uintptr_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { - LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); +static inline uintptr_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34158,21 +36236,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelUpdate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelUpdate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCommitmentUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34184,805 +36262,778 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKQueryChannelRange this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - QueryChannelRange_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv)); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr); + FREE((void*)this_ptr); + ChannelMessageHandler_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr); + FREE((void*)this_ptr); + RoutingMessageHandler_free(this_ptr_conv); } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKAcceptChannel obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_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_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = AcceptChannel_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKAnnouncementSignatures obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKQueryChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_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_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = AnnouncementSignatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelReestablish obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { - LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKQueryChannelRange arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_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_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = ChannelReestablish_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKQueryChannelRange orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKClosingSigned obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKReplyChannelRange this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReplyChannelRange_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_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_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = ClosingSigned_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKClosingSignedFeeRange obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_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_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = ClosingSignedFeeRange_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCommitmentSigned obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_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_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CommitmentSigned_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFundingCreated obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_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_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = FundingCreated_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFundingSigned obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKReplyChannelRange this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_u64Z val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_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_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = FundingSigned_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_blocknum_arg, int32_t number_of_blocks_arg, jboolean sync_complete_arg, int64_tArray short_channel_ids_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKCVec_u64Z short_channel_ids_arg_constr; - short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg); - if (short_channel_ids_arg_constr.datalen > 0) - short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL); - for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { - int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g]; - short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6; - } - (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0); - LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelReady obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { - LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKReplyChannelRange arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv); - return ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_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_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ"); + *ret_conv = ChannelReady_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKReplyChannelRange orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInit obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = Init_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKQueryShortChannelIds this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - QueryShortChannelIds_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_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_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = Init_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKQueryShortChannelIds this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOpenChannel obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryShortChannelIds_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKQueryShortChannelIds this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_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_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = OpenChannel_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKQueryShortChannelIds this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_u64Z val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t val_conv_6 = val_vals[g]; - val_constr.data[g] = val_conv_6; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKRevokeAndACK obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryShortChannelIds_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKCVec_u64Z short_channel_ids_arg_constr; - short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg); - if (short_channel_ids_arg_constr.datalen > 0) - short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); - else - short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL); - for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { - int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g]; - short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6; - } - (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0); - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_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_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = RevokeAndACK_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -static inline uintptr_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKShutdown obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKQueryShortChannelIds arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_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_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = Shutdown_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKQueryShortChannelIds orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateFailHTLC obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKReplyShortChannelIdsEnd this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ReplyShortChannelIdsEnd_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_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_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = UpdateFailHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateFailMalformedHTLC obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_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_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); + *ret_conv = UpdateFailMalformedHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateFee obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKReplyShortChannelIdsEnd this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_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_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); + *ret_conv = UpdateFee_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, jboolean full_information_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateFulfillHTLC obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_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_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); + *ret_conv = UpdateFulfillHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } - return ret_ref; + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUpdateAddHTLC obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKReplyShortChannelIdsEnd arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_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_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); + *ret_conv = UpdateAddHTLC_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKReplyShortChannelIdsEnd orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPing obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = Ping_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKGossipTimestampFilter this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - GossipTimestampFilter_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_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_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = Ping_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKPong obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = Pong_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_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_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = Pong_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedChannelAnnouncement obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_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_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = UnsignedChannelAnnouncement_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); - return ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelAnnouncement obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKGossipTimestampFilter this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_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_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); + *ret_conv = ChannelAnnouncement_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, int32_t first_timestamp_arg, int32_t timestamp_range_arg) { - LDKThirtyTwoBytes chain_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data); - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedChannelUpdate obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_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_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = UnsignedChannelUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } - return ret_ref; + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelUpdate obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKGossipTimestampFilter arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_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_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); + *ret_conv = ChannelUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKGossipTimestampFilter orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKErrorMessage obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr); - FREE((void*)this_ptr); - ErrorAction_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_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_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = ErrorMessage_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -static inline uintptr_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_clone(arg); -int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKWarningMessage obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKErrorAction* arg_conv = (LDKErrorAction*)arg; - int64_t ret_conv = ErrorAction_clone_ptr(arg_conv); - return ret_conv; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_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_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ"); + *ret_conv = WarningMessage_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKErrorAction* orig_conv = (LDKErrorAction*)orig; - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_clone(orig_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKUnsignedNodeAnnouncement obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) { - LDKErrorMessage msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = (msg & 1) || (msg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ErrorMessage_clone(&msg_conv); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_disconnect_peer(msg_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_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_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = UnsignedNodeAnnouncement_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) { - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_ignore_error(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeAnnouncement obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) { - LDKLevel a_conv = LDKLevel_from_java(env, a); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_ignore_and_log(a_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_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_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); + *ret_conv = NodeAnnouncement_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) { - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_ignore_duplicate_gossip(); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_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_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = QueryShortChannelIds_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) { - LDKErrorMessage msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = (msg & 1) || (msg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = ErrorMessage_clone(&msg_conv); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_send_error_message(msg_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKQueryShortChannelIds obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ErrorAction_1send_1warning_1message(JNIEnv *env, jclass clz, int64_t msg, jclass log_level) { - LDKWarningMessage msg_conv; - msg_conv.inner = (void*)(msg & (~1)); - msg_conv.is_owned = (msg & 1) || (msg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv = WarningMessage_clone(&msg_conv); - LDKLevel log_level_conv = LDKLevel_from_java(env, log_level); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKReplyShortChannelIdsEnd obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKLightningError this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - LightningError_free(this_obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_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_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr ret_str = LightningError_get_err(&this_ptr_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - Str_free(ret_str); +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKQueryChannelRange this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKStr val_conv = java_to_owned_str(env, val); - LightningError_set_err(&this_ptr_conv, val_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKQueryChannelRange obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_LightningError_1get_1action(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); - *ret_copy = LightningError_get_action(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_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_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = QueryChannelRange_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKLightningError this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); - val_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)val) & ~1)); - LightningError_set_action(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_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_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = ReplyChannelRange_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) { - LDKStr err_arg_conv = java_to_owned_str(env, err_arg); - void* action_arg_ptr = (void*)(((uintptr_t)action_arg) & ~1); - CHECK_ACCESS(action_arg_ptr); - LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr); - action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)action_arg) & ~1)); - LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKReplyChannelRange obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } -static inline uintptr_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { - LDKLightningError ret_var = LightningError_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKGossipTimestampFilter obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; } - return ret_ref; + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_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_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = GossipTimestampFilter_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKLightningError arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = LightningError_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr); + FREE((void*)this_ptr); + CustomMessageHandler_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKLightningError orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKLightningError ret_var = LightningError_clone(&orig_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKIgnoringMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + IgnoringMessageHandler_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) { + LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -34994,256 +37045,161 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEn return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCommitmentUpdate this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CommitmentUpdate_free(this_obj_conv); -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t p = 0; p < ret_var.datalen; p++) { - LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p]; - int64_t ret_conv_15_ref = 0; - CHECK((((uintptr_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); - ret_conv_15_ref = (uintptr_t)ret_conv_15_var.inner; - if (ret_conv_15_var.is_owned) { - ret_conv_15_ref |= 1; - } - ret_arr_ptr[p] = ret_conv_15_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateAddHTLCZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t p = 0; p < val_constr.datalen; p++) { - int64_t val_conv_15 = val_vals[p]; - LDKUpdateAddHTLC val_conv_15_conv; - val_conv_15_conv.inner = (void*)(val_conv_15 & (~1)); - val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); - val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); - val_constr.data[p] = val_conv_15_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t t = 0; t < ret_var.datalen; t++) { - LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t]; - int64_t ret_conv_19_ref = 0; - CHECK((((uintptr_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); - ret_conv_19_ref = (uintptr_t)ret_conv_19_var.inner; - if (ret_conv_19_var.is_owned) { - ret_conv_19_ref |= 1; - } - ret_arr_ptr[t] = ret_conv_19_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_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); + *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFulfillHTLCZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t t = 0; t < val_constr.datalen; t++) { - int64_t val_conv_19 = val_vals[t]; - LDKUpdateFulfillHTLC val_conv_19_conv; - val_conv_19_conv.inner = (void*)(val_conv_19 & (~1)); - val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); - val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); - val_constr.data[t] = val_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKIgnoringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); + *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t q = 0; q < ret_var.datalen; q++) { - LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; - if (ret_conv_16_var.is_owned) { - ret_conv_16_ref |= 1; - } - ret_arr_ptr[q] = ret_conv_16_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKErroringMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErroringMessageHandler_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFailHTLCZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t q = 0; q < val_constr.datalen; q++) { - int64_t val_conv_16 = val_vals[q]; - LDKUpdateFailHTLC val_conv_16_conv; - val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); - val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); - val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); - val_constr.data[q] = val_conv_16_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) { + LDKErroringMessageHandler ret_var = ErroringMessageHandler_new(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr); + return ret_ref; } -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); - int64_tArray ret_arr = NULL; - ret_arr = (*env)->NewLongArray(env, ret_var.datalen); - int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); - for (size_t z = 0; z < ret_var.datalen; z++) { - LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z]; - int64_t ret_conv_25_ref = 0; - CHECK((((uintptr_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); - ret_conv_25_ref = (uintptr_t)ret_conv_25_var.inner; - if (ret_conv_25_var.is_owned) { - ret_conv_25_ref |= 1; - } - ret_arr_ptr[z] = ret_conv_25_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_ErroringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKErroringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); + return (int64_t)ret_ret; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) { - LDKCommitmentUpdate this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKErroringMessageHandler this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); + *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKMessageHandler this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + MessageHandler_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_UpdateFailMalformedHTLCZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); - else - val_constr.data = NULL; - int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL); - for (size_t z = 0; z < val_constr.datalen; z++) { - int64_t val_conv_25 = val_vals[z]; - LDKUpdateFailMalformedHTLC val_conv_25_conv; - val_conv_25_conv.inner = (void*)(val_conv_25 & (~1)); - val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); - val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); - val_constr.data[z] = val_conv_25_conv; - } - (*env)->ReleaseLongArrayElements(env, val, val_vals, 0); - CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); - int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); + if (val_conv.free == LDKChannelMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChannelMessageHandler_JCalls_cloned(&val_conv); } - return ret_ref; + MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKCommitmentUpdate this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKUpdateFee val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = UpdateFee_clone(&val_conv); - CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_ret = ((uintptr_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; + return ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCommitmentUpdate this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); + if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRoutingMessageHandler_JCalls_cloned(&val_conv); + } + MessageHandler_set_route_handler(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv *env, jclass clz, int64_t chan_handler_arg, int64_t route_handler_arg) { + void* chan_handler_arg_ptr = (void*)(((uintptr_t)chan_handler_arg) & ~1); + CHECK_ACCESS(chan_handler_arg_ptr); + LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr); + if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv); + } + void* route_handler_arg_ptr = (void*)(((uintptr_t)route_handler_arg) & ~1); + CHECK_ACCESS(route_handler_arg_ptr); + LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr); + if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv); + } + LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -35255,99 +37211,64 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1comm return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKCommitmentUpdate this_ptr_conv; +static inline uintptr_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(arg); + return (int64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; + int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); + if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } + LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr; + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(orig_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr); + FREE((void*)this_ptr); + SocketDescriptor_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPeerHandleError this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PeerHandleError_free(this_obj_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCommitmentSigned val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = CommitmentSigned_clone(&val_conv); - CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); + jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEnv *env, jclass clz, int64_tArray update_add_htlcs_arg, int64_tArray update_fulfill_htlcs_arg, int64_tArray update_fail_htlcs_arg, int64_tArray update_fail_malformed_htlcs_arg, int64_t update_fee_arg, int64_t commitment_signed_arg) { - LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr; - update_add_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_add_htlcs_arg); - if (update_add_htlcs_arg_constr.datalen > 0) - update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); - else - update_add_htlcs_arg_constr.data = NULL; - int64_t* update_add_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_add_htlcs_arg, NULL); - for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { - int64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p]; - LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; - update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1)); - update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); - update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); - update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; - } - (*env)->ReleaseLongArrayElements(env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0); - LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr; - update_fulfill_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fulfill_htlcs_arg); - if (update_fulfill_htlcs_arg_constr.datalen > 0) - update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); - else - update_fulfill_htlcs_arg_constr.data = NULL; - int64_t* update_fulfill_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fulfill_htlcs_arg, NULL); - for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { - int64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t]; - LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; - update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1)); - update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); - update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); - update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; - } - (*env)->ReleaseLongArrayElements(env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0); - LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr; - update_fail_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_htlcs_arg); - if (update_fail_htlcs_arg_constr.datalen > 0) - update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); - else - update_fail_htlcs_arg_constr.data = NULL; - int64_t* update_fail_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_htlcs_arg, NULL); - for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { - int64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q]; - LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; - update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1)); - update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); - update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); - update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0); - LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr; - update_fail_malformed_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_malformed_htlcs_arg); - if (update_fail_malformed_htlcs_arg_constr.datalen > 0) - update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); - else - update_fail_malformed_htlcs_arg_constr.data = NULL; - int64_t* update_fail_malformed_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_malformed_htlcs_arg, NULL); - for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { - int64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; - LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; - update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1)); - update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); - update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); - update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; - } - (*env)->ReleaseLongArrayElements(env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0); - LDKUpdateFee update_fee_arg_conv; - update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); - update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); - update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); - LDKCommitmentSigned commitment_signed_arg_conv; - commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); - commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); - commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); - LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKPeerHandleError this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz, jboolean no_connection_possible_arg) { + LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -35359,8 +37280,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn return ret_ref; } -static inline uintptr_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { - LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); +static inline uintptr_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { + LDKPeerHandleError ret_var = PeerHandleError_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -35371,21 +37292,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCommitmentUpdate arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPeerHandleError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCommitmentUpdate orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKPeerHandleError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); + LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -35397,778 +37318,1110 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr); - FREE((void*)this_ptr); - ChannelMessageHandler_free(this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPeerManager this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PeerManager_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr); - FREE((void*)this_ptr); - RoutingMessageHandler_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) { + LDKMessageHandler message_handler_conv; + message_handler_conv.inner = (void*)(message_handler & (~1)); + message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv); + // WARNING: we need a move here but no clone is available for LDKMessageHandler + LDKSecretKey our_node_secret_ref; + CHECK((*env)->GetArrayLength(env, our_node_secret) == 32); + (*env)->GetByteArrayRegion(env, our_node_secret, 0, 32, our_node_secret_ref.bytes); + unsigned char ephemeral_random_data_arr[32]; + CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32); + (*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr); + unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr; + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + void* custom_message_handler_ptr = (void*)(((uintptr_t)custom_message_handler) & ~1); + CHECK_ACCESS(custom_message_handler_ptr); + LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr); + if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv); + } + LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKAcceptChannel obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); + jobjectArray ret_arr = NULL; + ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; + for (size_t i = 0; i < ret_var.datalen; i++) { + int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); + (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + } + + FREE(ret_var.data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_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_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); - *ret_conv = AcceptChannel_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t descriptor, int64_t remote_network_address) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + 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); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); + CHECK_ACCESS(descriptor_ptr); + LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); + if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); + } + void* remote_network_address_ptr = (void*)(((uintptr_t)remote_network_address) & ~1); + CHECK_ACCESS(remote_network_address_ptr); + LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKAnnouncementSignatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_PeerManager_1new_1inbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor, int64_t remote_network_address) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); + CHECK_ACCESS(descriptor_ptr); + LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); + if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); + } + void* remote_network_address_ptr = (void*)(((uintptr_t)remote_network_address) & ~1); + CHECK_ACCESS(remote_network_address_ptr); + LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_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_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); - *ret_conv = AnnouncementSignatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); + if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelReestablish obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t peer_descriptor, int8_tArray data) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* peer_descriptor_ptr = (void*)(((uintptr_t)peer_descriptor) & ~1); + if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } + LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; + LDKu8slice data_ref; + data_ref.datalen = (*env)->GetArrayLength(env, data); + data_ref.data = (*env)->GetByteArrayElements (env, data, NULL); + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); + (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + PeerManager_process_events(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); + if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } + LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; + PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id, jboolean no_connection_possible) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKPublicKey node_id_ref; + CHECK((*env)->GetArrayLength(env, node_id) == 33); + (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); + PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + PeerManager_disconnect_all_peers(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKPeerManager this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + PeerManager_timer_tick_occurred(&this_arg_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) { + int64_t ret_conv = htlc_success_tx_weight(opt_anchors); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) { + int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) { + unsigned char commitment_seed_arr[32]; + CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); + (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_arr); + unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr; + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1closing_1transaction(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) { + LDKCVec_u8Z to_holder_script_ref; + to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script); + to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data); + LDKCVec_u8Z to_counterparty_script_ref; + to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script); + to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data); + LDKOutPoint funding_outpoint_conv; + funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); + funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); + funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); + LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); + Transaction_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_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_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); - *ret_conv = ChannelReestablish_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCounterpartyCommitmentSecrets this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CounterpartyCommitmentSecrets_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKClosingSigned obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +static inline uintptr_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) { + LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_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_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); - *ret_conv = ClosingSigned_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyCommitmentSecrets arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKClosingSignedFeeRange obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyCommitmentSecrets_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCounterpartyCommitmentSecrets orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_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_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); - *ret_conv = ClosingSignedFeeRange_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1new(JNIEnv *env, jclass clz) { + LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCommitmentSigned obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyCommitmentSecrets_1get_1min_1seen_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCounterpartyCommitmentSecrets this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_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_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); - *ret_conv = CommitmentSigned_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1provide_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx, int8_tArray secret) { + LDKCounterpartyCommitmentSecrets this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKThirtyTwoBytes secret_ref; + CHECK((*env)->GetArrayLength(env, secret) == 32); + (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_ref.data); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFundingCreated obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { + LDKCounterpartyCommitmentSecrets this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_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_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); - *ret_conv = FundingCreated_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFundingSigned obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCounterpartyCommitmentSecrets obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); + LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_FundingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_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_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); - *ret_conv = FundingSigned_read(ser_ref); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFundingLocked obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_derive_1private_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_secret) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + unsigned char base_secret_arr[32]; + CHECK((*env)->GetArrayLength(env, base_secret) == 32); + (*env)->GetByteArrayRegion(env, base_secret, 0, 32, base_secret_arr); + unsigned char (*base_secret_ref)[32] = &base_secret_arr; + LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); + *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_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_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); - *ret_conv = FundingLocked_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_point) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKPublicKey base_point_ref; + CHECK((*env)->GetArrayLength(env, base_point) == 33); + (*env)->GetByteArrayRegion(env, base_point, 0, 33, base_point_ref.compressed_form); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInit obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Init_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_derive_1private_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_secret, int8_tArray countersignatory_revocation_base_secret) { + unsigned char per_commitment_secret_arr[32]; + CHECK((*env)->GetArrayLength(env, per_commitment_secret) == 32); + (*env)->GetByteArrayRegion(env, per_commitment_secret, 0, 32, per_commitment_secret_arr); + unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr; + unsigned char countersignatory_revocation_base_secret_arr[32]; + CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_secret) == 32); + (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr); + unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr; + LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); + *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_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_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); - *ret_conv = Init_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray countersignatory_revocation_base_point) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKPublicKey countersignatory_revocation_base_point_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_point) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKOpenChannel obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTxCreationKeys this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TxCreationKeys_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_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_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); - *ret_conv = OpenChannel_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKRevokeAndACK obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_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_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); - *ret_conv = RevokeAndACK_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKShutdown obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_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_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); - *ret_conv = Shutdown_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateFailHTLC obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_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_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); - *ret_conv = UpdateFailHTLC_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateFailMalformedHTLC obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_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_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); - *ret_conv = UpdateFailMalformedHTLC_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKTxCreationKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateFee obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_TxCreationKeys_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point_arg, int8_tArray revocation_key_arg, int8_tArray broadcaster_htlc_key_arg, int8_tArray countersignatory_htlc_key_arg, int8_tArray broadcaster_delayed_payment_key_arg) { + LDKPublicKey per_commitment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); + LDKPublicKey revocation_key_arg_ref; + CHECK((*env)->GetArrayLength(env, revocation_key_arg) == 33); + (*env)->GetByteArrayRegion(env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form); + LDKPublicKey broadcaster_htlc_key_arg_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_htlc_key_arg) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form); + LDKPublicKey countersignatory_htlc_key_arg_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_htlc_key_arg) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form); + LDKPublicKey broadcaster_delayed_payment_key_arg_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form); + LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_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_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); - *ret_conv = UpdateFee_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +static inline uintptr_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { + LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateFulfillHTLC obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxCreationKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_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_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); - *ret_conv = UpdateFulfillHTLC_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKTxCreationKeys orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUpdateAddHTLC obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKTxCreationKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); + LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_UpdateAddHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_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_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); - *ret_conv = UpdateAddHTLC_read(ser_ref); + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = TxCreationKeys_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPing obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Ping_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelPublicKeys this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelPublicKeys_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_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_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); - *ret_conv = Ping_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKPong obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Pong_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_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_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); - *ret_conv = Pong_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedChannelAnnouncement obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_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_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); - *ret_conv = UnsignedChannelAnnouncement_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelAnnouncement obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_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_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); - *ret_conv = ChannelAnnouncement_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedChannelUpdate obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_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_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); - *ret_conv = UnsignedChannelUpdate_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKChannelPublicKeys this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKPublicKey val_ref; + CHECK((*env)->GetArrayLength(env, val) == 33); + (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); + ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelUpdate obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv *env, jclass clz, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg) { + LDKPublicKey funding_pubkey_arg_ref; + CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33); + (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); + LDKPublicKey revocation_basepoint_arg_ref; + CHECK((*env)->GetArrayLength(env, revocation_basepoint_arg) == 33); + (*env)->GetByteArrayRegion(env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form); + LDKPublicKey payment_point_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_point_arg) == 33); + (*env)->GetByteArrayRegion(env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form); + LDKPublicKey delayed_payment_basepoint_arg_ref; + CHECK((*env)->GetArrayLength(env, delayed_payment_basepoint_arg) == 33); + (*env)->GetByteArrayRegion(env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form); + LDKPublicKey htlc_basepoint_arg_ref; + CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33); + (*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form); + LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelPublicKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelPublicKeys orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelPublicKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_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_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); - *ret_conv = ChannelUpdate_read(ser_ref); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = ChannelPublicKeys_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKErrorMessage obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_TxCreationKeys_1derive_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray broadcaster_delayed_payment_base, int8_tArray broadcaster_htlc_base, int8_tArray countersignatory_revocation_base, int8_tArray countersignatory_htlc_base) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKPublicKey broadcaster_delayed_payment_base_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_base) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form); + LDKPublicKey broadcaster_htlc_base_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_htlc_base) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form); + LDKPublicKey countersignatory_revocation_base_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form); + LDKPublicKey countersignatory_htlc_base_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_htlc_base) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form); + LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); + *ret_conv = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref); + return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_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_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); - *ret_conv = ErrorMessage_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1channel_1static_1keys(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int64_t broadcaster_keys, int64_t countersignatory_keys) { + LDKPublicKey per_commitment_point_ref; + CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); + (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); + LDKChannelPublicKeys broadcaster_keys_conv; + broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); + broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); + LDKChannelPublicKeys countersignatory_keys_conv; + countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); + countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); + LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); + *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKWarningMessage obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv *env, jclass clz, int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) { + LDKPublicKey revocation_key_ref; + CHECK((*env)->GetArrayLength(env, revocation_key) == 33); + (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form); + LDKPublicKey broadcaster_delayed_payment_key_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); + LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_WarningMessage_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_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ"); - *ret_conv = WarningMessage_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHTLCOutputInCommitment this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HTLCOutputInCommitment_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKUnsignedNodeAnnouncement obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv)); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_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_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); - *ret_conv = UnsignedNodeAnnouncement_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKHTLCOutputInCommitment this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); + HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new(JNIEnv *env, jclass clz, jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t transaction_output_index_arg) { + LDKThirtyTwoBytes payment_hash_arg_ref; + CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32); + (*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data); + void* transaction_output_index_arg_ptr = (void*)(((uintptr_t)transaction_output_index_arg) & ~1); + CHECK_ACCESS(transaction_output_index_arg_ptr); + LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr); + transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)transaction_output_index_arg) & ~1)); + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +static inline uintptr_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCOutputInCommitment arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCOutputInCommitment orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeAnnouncement obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); + LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_NodeAnnouncement_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_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); - *ret_conv = NodeAnnouncement_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_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_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); - *ret_conv = QueryShortChannelIds_read(ser_ref); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = HTLCOutputInCommitment_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKQueryShortChannelIds obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKReplyShortChannelIdsEnd obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv *env, jclass clz, int64_t htlc, jboolean opt_anchors, int64_t keys) { + LDKHTLCOutputInCommitment htlc_conv; + htlc_conv.inner = (void*)(htlc & (~1)); + htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); + LDKTxCreationKeys keys_conv; + keys_conv.inner = (void*)(keys & (~1)); + keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); + LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ReplyShortChannelIdsEnd_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_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); - *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKQueryChannelRange this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKQueryChannelRange obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv *env, jclass clz, int8_tArray broadcaster, int8_tArray countersignatory) { + LDKPublicKey broadcaster_ref; + CHECK((*env)->GetArrayLength(env, broadcaster) == 33); + (*env)->GetByteArrayRegion(env, broadcaster, 0, 33, broadcaster_ref.compressed_form); + LDKPublicKey countersignatory_ref; + CHECK((*env)->GetArrayLength(env, countersignatory) == 33); + (*env)->GetByteArrayRegion(env, countersignatory, 0, 33, countersignatory_ref.compressed_form); + LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_QueryChannelRange_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_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); - *ret_conv = QueryChannelRange_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_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_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); - *ret_conv = ReplyChannelRange_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKReplyChannelRange obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { + unsigned char commitment_txid_arr[32]; + CHECK((*env)->GetArrayLength(env, commitment_txid) == 32); + (*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr); + unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr; + LDKHTLCOutputInCommitment htlc_conv; + htlc_conv.inner = (void*)(htlc & (~1)); + htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); + LDKPublicKey broadcaster_delayed_payment_key_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); + LDKPublicKey revocation_key_ref; + CHECK((*env)->GetArrayLength(env, revocation_key) == 33); + (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form); + LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); + Transaction_free(ret_var); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKGossipTimestampFilter obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) { + LDKPublicKey funding_pubkey_ref; + CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33); + (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form); + LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_GossipTimestampFilter_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_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); - *ret_conv = GossipTimestampFilter_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr); - FREE((void*)this_ptr); - CustomMessageHandler_free(this_ptr_conv); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKIgnoringMessageHandler this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - IgnoringMessageHandler_free(this_obj_conv); + ChannelTransactionParameters_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) { - LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36180,161 +38433,153 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelPublicKeys val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelPublicKeys_clone(&val_conv); + ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); - *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKIgnoringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); - *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); - return (int64_t)ret_ret; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKErroringMessageHandler this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErroringMessageHandler_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) { - LDKErroringMessageHandler ret_var = ErroringMessageHandler_new(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKErroringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKErroringMessageHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); - *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKMessageHandler this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - MessageHandler_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCounterpartyChannelTransactionParameters val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); + ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; - return ret_ret; + LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); - if (val_conv.free == LDKChannelMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChannelMessageHandler_JCalls_cloned(&val_conv); - } - MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); + LDKOutPoint val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = OutPoint_clone(&val_conv); + ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_ret = ((uintptr_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; - return ret_ret; + jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv)); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKMessageHandler this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); - if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRoutingMessageHandler_JCalls_cloned(&val_conv); - } - MessageHandler_set_route_handler(&this_ptr_conv, val_conv); + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); + ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv *env, jclass clz, int64_t chan_handler_arg, int64_t route_handler_arg) { - void* chan_handler_arg_ptr = (void*)(((uintptr_t)chan_handler_arg) & ~1); - CHECK_ACCESS(chan_handler_arg_ptr); - LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr); - if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv); - } - void* route_handler_arg_ptr = (void*)(((uintptr_t)route_handler_arg) & ~1); - CHECK_ACCESS(route_handler_arg_ptr); - LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr); - if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv); - } - LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg, jclass opt_anchors_arg) { + LDKChannelPublicKeys holder_pubkeys_arg_conv; + holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); + holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv); + holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); + LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; + counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); + counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); + counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); + LDKOutPoint funding_outpoint_arg_conv; + funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); + funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv); + funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); + LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg); + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36346,64 +38591,106 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv return ret_ref; } -static inline uintptr_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { - LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); - *ret_ret = SocketDescriptor_clone(arg); - return (int64_t)ret_ret; +static inline uintptr_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); - if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } - LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; - int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv); - return ret_conv; + return ret_ref; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { - void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); - if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } - LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr; - LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); - *ret_ret = SocketDescriptor_clone(orig_conv); - return (int64_t)ret_ret; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); - CHECK_ACCESS(this_ptr_ptr); - LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr); - FREE((void*)this_ptr); - SocketDescriptor_free(this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelTransactionParameters orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPeerHandleError this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCounterpartyChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PeerHandleError_free(this_obj_conv); + CounterpartyChannelTransactionParameters_free(this_obj_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKPeerHandleError this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv); + LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKChannelPublicKeys val_conv; + val_conv.inner = (void*)(val & (~1)); + val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); + val_conv = ChannelPublicKeys_clone(&val_conv); + CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); +} + +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKPeerHandleError this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { + LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); + CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz, jboolean no_connection_possible_arg) { - LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t pubkeys_arg, int16_t selected_contest_delay_arg) { + LDKChannelPublicKeys pubkeys_arg_conv; + pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); + pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); + pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36415,8 +38702,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv return ret_ref; } -static inline uintptr_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { - LDKPeerHandleError ret_var = PeerHandleError_clone(arg); +static inline uintptr_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36427,21 +38714,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKPeerHandleError arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyChannelTransactionParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv); + int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKPeerHandleError orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCounterpartyChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36453,42 +38740,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIE return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKPeerManager this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - PeerManager_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) { - LDKMessageHandler message_handler_conv; - message_handler_conv.inner = (void*)(message_handler & (~1)); - message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv); - // WARNING: we need a move here but no clone is available for LDKMessageHandler - LDKSecretKey our_node_secret_ref; - CHECK((*env)->GetArrayLength(env, our_node_secret) == 32); - (*env)->GetByteArrayRegion(env, our_node_secret, 0, 32, our_node_secret_ref.bytes); - unsigned char ephemeral_random_data_arr[32]; - CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32); - (*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr); - unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr; - void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (logger_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&logger_conv); - } - void* custom_message_handler_ptr = (void*)(((uintptr_t)custom_message_handler) & ~1); - CHECK_ACCESS(custom_message_handler_ptr); - LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr); - if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv); - } - LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTransactionParameters this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36500,195 +38766,205 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en return ret_ref; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPeerManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); - jobjectArray ret_arr = NULL; - ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - ; - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); - (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr); + LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } - - FREE(ret_var.data); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCounterpartyChannelTransactionParameters obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_PeerManager_1new_1outbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t descriptor, int64_t remote_network_address) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - 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); - void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); - CHECK_ACCESS(descriptor_ptr); - LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); - if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); - } - void* remote_network_address_ptr = (void*)(((uintptr_t)remote_network_address) & ~1); - CHECK_ACCESS(remote_network_address_ptr); - LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); - LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); - *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor, int64_t remote_network_address) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); - CHECK_ACCESS(descriptor_ptr); - LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); - if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSocketDescriptor_JCalls_cloned(&descriptor_conv); - } - void* remote_network_address_ptr = (void*)(((uintptr_t)remote_network_address) & ~1); - CHECK_ACCESS(remote_network_address_ptr); - LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr); - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv); - return (int64_t)ret_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelTransactionParameters obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_PeerManager_1write_1buffer_1space_1avail(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) { - LDKPeerManager this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); - if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; - LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); - *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_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_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = ChannelTransactionParameters_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t peer_descriptor, int8_tArray data) { - LDKPeerManager this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDirectedChannelTransactionParameters this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DirectedChannelTransactionParameters_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* peer_descriptor_ptr = (void*)(((uintptr_t)peer_descriptor) & ~1); - if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } - LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; - LDKu8slice data_ref; - data_ref.datalen = (*env)->GetArrayLength(env, data); - data_ref.data = (*env)->GetByteArrayElements (env, data, NULL); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); - (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0); - return (int64_t)ret_conv; + LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPeerManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - PeerManager_process_events(&this_arg_conv); + LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) { - LDKPeerManager this_arg_conv; +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); - if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } - LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; - PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); + int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id, jboolean no_connection_possible) { - LDKPeerManager this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKPublicKey node_id_ref; - CHECK((*env)->GetArrayLength(env, node_id) == 33); - (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); - PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible); + jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPeerManager this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - PeerManager_disconnect_all_peers(&this_arg_conv); + LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKPeerManager this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - PeerManager_timer_tick_occurred(&this_arg_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) { - int64_t ret_conv = htlc_success_tx_weight(opt_anchors); + jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) { - int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKHolderCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + HolderCommitmentTransaction_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) { - unsigned char commitment_seed_arr[32]; - CHECK((*env)->GetArrayLength(env, commitment_seed) == 32); - (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_arr); - unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKHolderCommitmentTransaction this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form); return ret_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1closing_1transaction(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) { - LDKCVec_u8Z to_holder_script_ref; - to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script); - to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data); - LDKCVec_u8Z to_counterparty_script_ref; - to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script); - to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data); - LDKOutPoint funding_outpoint_conv; - funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); - funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); - funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); - LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Transaction_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKHolderCommitmentTransaction this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKSignature val_ref; + CHECK((*env)->GetArrayLength(env, val) == 64); + (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); + HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCounterpartyCommitmentSecrets this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CounterpartyCommitmentSecrets_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { + LDKHolderCommitmentTransaction this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKCVec_SignatureZ val_constr; + val_constr.datalen = (*env)->GetArrayLength(env, val); + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + val_constr.data = NULL; + for (size_t i = 0; i < val_constr.datalen; i++) { + int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); + LDKSignature val_conv_8_ref; + CHECK((*env)->GetArrayLength(env, val_conv_8) == 64); + (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form); + val_constr.data[i] = val_conv_8_ref; + } + HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } -static inline uintptr_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) { - LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg); +static inline uintptr_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36699,34 +38975,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCounterpartyCommitmentSecrets arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHolderCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv); + int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCounterpartyCommitmentSecrets orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHolderCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1new(JNIEnv *env, jclass clz) { - LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new(); + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36735,244 +38998,135 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecre if (ret_var.is_owned) { ret_ref |= 1; } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1min_1seen_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCounterpartyCommitmentSecrets this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1provide_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx, int8_tArray secret) { - LDKCounterpartyCommitmentSecrets this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKThirtyTwoBytes secret_ref; - CHECK((*env)->GetArrayLength(env, secret) == 32); - (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_ref.data); - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { - LDKCounterpartyCommitmentSecrets this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data); - return ret_arr; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCounterpartyCommitmentSecrets obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_CounterpartyCommitmentSecrets_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_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_secret) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - unsigned char base_secret_arr[32]; - CHECK((*env)->GetArrayLength(env, base_secret) == 32); - (*env)->GetByteArrayRegion(env, base_secret, 0, 32, base_secret_arr); - unsigned char (*base_secret_ref)[32] = &base_secret_arr; - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_point) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKPublicKey base_point_ref; - CHECK((*env)->GetArrayLength(env, base_point) == 33); - (*env)->GetByteArrayRegion(env, base_point, 0, 33, base_point_ref.compressed_form); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_secret, int8_tArray countersignatory_revocation_base_secret) { - unsigned char per_commitment_secret_arr[32]; - CHECK((*env)->GetArrayLength(env, per_commitment_secret) == 32); - (*env)->GetByteArrayRegion(env, per_commitment_secret, 0, 32, per_commitment_secret_arr); - unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr; - unsigned char countersignatory_revocation_base_secret_arr[32]; - CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_secret) == 32); - (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr); - unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr; - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray countersignatory_revocation_base_point) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKPublicKey countersignatory_revocation_base_point_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_point) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKTxCreationKeys this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TxCreationKeys_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form); - return ret_arr; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKHolderCommitmentTransaction obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_TxCreationKeys_1set_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = HolderCommitmentTransaction_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new(JNIEnv *env, jclass clz, int64_t commitment_tx, int8_tArray counterparty_sig, jobjectArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { + LDKCommitmentTransaction commitment_tx_conv; + commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); + commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); + commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); + LDKSignature counterparty_sig_ref; + CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64); + (*env)->GetByteArrayRegion(env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form); + LDKCVec_SignatureZ counterparty_htlc_sigs_constr; + counterparty_htlc_sigs_constr.datalen = (*env)->GetArrayLength(env, counterparty_htlc_sigs); + if (counterparty_htlc_sigs_constr.datalen > 0) + counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); + else + counterparty_htlc_sigs_constr.data = NULL; + for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) { + int8_tArray counterparty_htlc_sigs_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i); + LDKSignature counterparty_htlc_sigs_conv_8_ref; + CHECK((*env)->GetArrayLength(env, counterparty_htlc_sigs_conv_8) == 64); + (*env)->GetByteArrayRegion(env, counterparty_htlc_sigs_conv_8, 0, 64, counterparty_htlc_sigs_conv_8_ref.compact_form); + counterparty_htlc_sigs_constr.data[i] = counterparty_htlc_sigs_conv_8_ref; + } + LDKPublicKey holder_funding_key_ref; + CHECK((*env)->GetArrayLength(env, holder_funding_key) == 33); + (*env)->GetByteArrayRegion(env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form); + LDKPublicKey counterparty_funding_key_ref; + CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33); + (*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form); + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBuiltCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + BuiltCommitmentTransaction_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form); + LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&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); + Transaction_free(ret_var); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); + LDKTransaction val_ref; + val_ref.datalen = (*env)->GetArrayLength(env, val); + val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); + val_ref.data_is_owned = true; + BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv)); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKTxCreationKeys this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { + LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); + LDKThirtyTwoBytes val_ref; + CHECK((*env)->GetArrayLength(env, val) == 32); + (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); + BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point_arg, int8_tArray revocation_key_arg, int8_tArray broadcaster_htlc_key_arg, int8_tArray countersignatory_htlc_key_arg, int8_tArray broadcaster_delayed_payment_key_arg) { - LDKPublicKey per_commitment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form); - LDKPublicKey revocation_key_arg_ref; - CHECK((*env)->GetArrayLength(env, revocation_key_arg) == 33); - (*env)->GetByteArrayRegion(env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form); - LDKPublicKey broadcaster_htlc_key_arg_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_htlc_key_arg) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form); - LDKPublicKey countersignatory_htlc_key_arg_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_htlc_key_arg) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form); - LDKPublicKey broadcaster_delayed_payment_key_arg_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form); - LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new(JNIEnv *env, jclass clz, int8_tArray transaction_arg, int8_tArray txid_arg) { + LDKTransaction transaction_arg_ref; + transaction_arg_ref.datalen = (*env)->GetArrayLength(env, transaction_arg); + transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, transaction_arg, 0, transaction_arg_ref.datalen, transaction_arg_ref.data); + transaction_arg_ref.data_is_owned = true; + LDKThirtyTwoBytes txid_arg_ref; + CHECK((*env)->GetArrayLength(env, txid_arg) == 32); + (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data); + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36984,8 +39138,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv return ret_ref; } -static inline uintptr_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { - LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +static inline uintptr_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -36996,21 +39150,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKTxCreationKeys arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBuiltCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv); + int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKTxCreationKeys orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBuiltCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37022,158 +39176,147 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEn return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKTxCreationKeys obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBuiltCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); + LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_TxCreationKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_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_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = TxCreationKeys_read(ser_ref); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = BuiltCommitmentTransaction_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelPublicKeys this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelPublicKeys_free(this_obj_conv); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKBuiltCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); + funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data); + (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKBuiltCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char funding_key_arr[32]; + CHECK((*env)->GetArrayLength(env, funding_key) == 32); + (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); + unsigned char (*funding_key_ref)[32] = &funding_key_arr; + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); + funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); + (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKClosingTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ClosingTransaction_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form); - return ret_arr; +static inline uintptr_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { + LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); + return ret_ref; } - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKClosingTransaction orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form); - return ret_arr; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKClosingTransaction o_conv; + o_conv.inner = (void*)(o & (~1)); + o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + int64_t ret_conv = ClosingTransaction_hash(&o_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKChannelPublicKeys this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKPublicKey val_ref; - CHECK((*env)->GetArrayLength(env, val) == 33); - (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); - ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) { + LDKCVec_u8Z to_holder_script_ref; + to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script); + to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data); + LDKCVec_u8Z to_counterparty_script_ref; + to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script); + to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data); + LDKOutPoint funding_outpoint_conv; + funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); + funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); + funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); + LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv *env, jclass clz, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_point_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg) { - LDKPublicKey funding_pubkey_arg_ref; - CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33); - (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form); - LDKPublicKey revocation_basepoint_arg_ref; - CHECK((*env)->GetArrayLength(env, revocation_basepoint_arg) == 33); - (*env)->GetByteArrayRegion(env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form); - LDKPublicKey payment_point_arg_ref; - CHECK((*env)->GetArrayLength(env, payment_point_arg) == 33); - (*env)->GetByteArrayRegion(env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form); - LDKPublicKey delayed_payment_basepoint_arg_ref; - CHECK((*env)->GetArrayLength(env, delayed_payment_basepoint_arg) == 33); - (*env)->GetByteArrayRegion(env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form); - LDKPublicKey htlc_basepoint_arg_ref; - CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33); - (*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form); - LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37185,8 +39328,123 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE return ret_ref; } -static inline uintptr_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { - LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_outpoint) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKOutPoint funding_outpoint_conv; + funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); + funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); + funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); + LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); + *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTrustedClosingTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + TrustedClosingTransaction_free(this_obj_conv); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Transaction_free(ret_var); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKTrustedClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); + funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data); + (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { + LDKTrustedClosingTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char funding_key_arr[32]; + CHECK((*env)->GetArrayLength(env, funding_key) == 32); + (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); + unsigned char (*funding_key_ref)[32] = &funding_key_arr; + LDKu8slice funding_redeemscript_ref; + funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); + funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); + int8_tArray ret_arr = (*env)->NewByteArray(env, 64); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); + (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); + return ret_arr; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKCommitmentTransaction this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + CommitmentTransaction_free(this_obj_conv); +} + +static inline uintptr_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37197,21 +39455,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelPublicKeys arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv); + int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelPublicKeys orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37223,53 +39481,90 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JN return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelPublicKeys obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); + LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 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_ChannelPublicKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_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_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = ChannelPublicKeys_read(ser_ref); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CommitmentTransaction_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray broadcaster_delayed_payment_base, int8_tArray broadcaster_htlc_base, int8_tArray countersignatory_revocation_base, int8_tArray countersignatory_htlc_base) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); - LDKPublicKey broadcaster_delayed_payment_base_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_base) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form); - LDKPublicKey broadcaster_htlc_base_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_htlc_base) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form); - LDKPublicKey countersignatory_revocation_base_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form); - LDKPublicKey countersignatory_htlc_base_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_htlc_base) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref); - return (int64_t)ret_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1channel_1static_1keys(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int64_t broadcaster_keys, int64_t countersignatory_keys) { - LDKPublicKey per_commitment_point_ref; - CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33); - (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters, int64_t broadcaster_keys, int64_t countersignatory_keys) { + LDKCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKDirectedChannelTransactionParameters channel_parameters_conv; + channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); + channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; @@ -37278,137 +39573,35 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1chann countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv *env, jclass clz, int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) { - LDKPublicKey revocation_key_ref; - CHECK((*env)->GetArrayLength(env, revocation_key) == 33); - (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form); - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); - LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKHTLCOutputInCommitment this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKTrustedCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HTLCOutputInCommitment_free(this_obj_conv); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); -} - -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); + TrustedCommitmentTransaction_free(this_obj_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv)); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data); return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); - int64_t ret_ref = (uintptr_t)ret_copy; - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKHTLCOutputInCommitment this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uintptr_t)val) & ~1); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); - HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new(JNIEnv *env, jclass clz, jboolean offered_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, int64_t transaction_output_index_arg) { - LDKThirtyTwoBytes payment_hash_arg_ref; - CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32); - (*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data); - void* transaction_output_index_arg_ptr = (void*)(((uintptr_t)transaction_output_index_arg) & ~1); - CHECK_ACCESS(transaction_output_index_arg_ptr); - LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr); - transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)transaction_output_index_arg) & ~1)); - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37420,33 +39613,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new return ret_ref; } -static inline uintptr_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHTLCOutputInCommitment arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHTLCOutputInCommitment orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37458,105 +39630,136 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clo return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHTLCOutputInCommitment obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_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_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = HTLCOutputInCommitment_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_base_key, int64_t channel_parameters) { + LDKTrustedCommitmentTransaction this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + unsigned char htlc_base_key_arr[32]; + CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); + (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr); + unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr; + LDKDirectedChannelTransactionParameters channel_parameters_conv; + channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); + channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); return (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv *env, jclass clz, int64_t htlc, jboolean opt_anchors, int64_t keys) { - LDKHTLCOutputInCommitment htlc_conv; - htlc_conv.inner = (void*)(htlc & (~1)); - htlc_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); - LDKTxCreationKeys keys_conv; - keys_conv.inner = (void*)(keys & (~1)); - keys_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); - LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_get_1commitment_1transaction_1number_1obscure_1factor(JNIEnv *env, jclass clz, int8_tArray broadcaster_payment_basepoint, int8_tArray countersignatory_payment_basepoint, jboolean outbound_from_broadcaster) { + LDKPublicKey broadcaster_payment_basepoint_ref; + CHECK((*env)->GetArrayLength(env, broadcaster_payment_basepoint) == 33); + (*env)->GetByteArrayRegion(env, broadcaster_payment_basepoint, 0, 33, broadcaster_payment_basepoint_ref.compressed_form); + LDKPublicKey countersignatory_payment_basepoint_ref; + CHECK((*env)->GetArrayLength(env, countersignatory_payment_basepoint) == 33); + (*env)->GetByteArrayRegion(env, countersignatory_payment_basepoint, 0, 33, countersignatory_payment_basepoint_ref.compressed_form); + int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv *env, jclass clz, int8_tArray broadcaster, int8_tArray countersignatory) { - LDKPublicKey broadcaster_ref; - CHECK((*env)->GetArrayLength(env, broadcaster) == 33); - (*env)->GetByteArrayRegion(env, broadcaster, 0, 33, broadcaster_ref.compressed_form); - LDKPublicKey countersignatory_ref; - CHECK((*env)->GetArrayLength(env, countersignatory) == 33); - (*env)->GetByteArrayRegion(env, countersignatory, 0, 33, countersignatory_ref.compressed_form); - LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInitFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKInitFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { - unsigned char commitment_txid_arr[32]; - CHECK((*env)->GetArrayLength(env, commitment_txid) == 32); - (*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr); - unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr; - LDKHTLCOutputInCommitment htlc_conv; - htlc_conv.inner = (void*)(htlc & (~1)); - htlc_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); - LDKPublicKey broadcaster_delayed_payment_key_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); - LDKPublicKey revocation_key_ref; - CHECK((*env)->GetArrayLength(env, revocation_key) == 33); - (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form); - LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Transaction_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKNodeFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKNodeFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) { - LDKPublicKey funding_pubkey_ref; - CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33); - (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form); - LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKChannelFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelTransactionParameters this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTransactionParameters_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInvoiceFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKInvoiceFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKChannelTypeFeatures a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKChannelTypeFeatures b_conv; + b_conv.inner = (void*)(b & (~1)); + b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uintptr_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInitFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInitFeatures orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37568,153 +39771,109 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelPublicKeys val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelPublicKeys_clone(&val_conv); - ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); -} - -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); - return ret_conv; +static inline uintptr_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); + return ret_ref; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKNodeFeatures orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCounterpartyChannelTransactionParameters val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); - ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); +static inline uintptr_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; +} + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelFeatures orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); int64_t ret_ref = 0; - if ((uintptr_t)ret_var.inner > 4096) { - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; } return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKOutPoint val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = OutPoint_clone(&val_conv); - ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); +static inline uintptr_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv)); - return ret_conv; + return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { - LDKChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); - ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg, jclass opt_anchors_arg) { - LDKChannelPublicKeys holder_pubkeys_arg_conv; - holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); - holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv); - holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); - LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; - counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); - counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); - counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); - LDKOutPoint funding_outpoint_arg_conv; - funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); - funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv); - funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); - LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg); - LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceFeatures orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37726,8 +39885,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -static inline uintptr_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { - LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); +static inline uintptr_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37738,21 +39897,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelTransactionParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelTypeFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelTransactionParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelTypeFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37764,20 +39923,48 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCounterpartyChannelTransactionParameters this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInitFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CounterpartyChannelTransactionParameters_free(this_obj_conv); + InitFeatures_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKNodeFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + NodeFeatures_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelFeatures_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceFeatures_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelTypeFeatures this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelTypeFeatures_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInitFeatures ret_var = InitFeatures_empty(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37789,43 +39976,43 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKCounterpartyChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKChannelPublicKeys val_conv; - val_conv.inner = (void*)(val & (~1)); - val_conv.is_owned = (val & 1) || (val == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); - val_conv = ChannelPublicKeys_clone(&val_conv); - CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv *env, jclass clz) { + LDKInitFeatures ret_var = InitFeatures_known(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKCounterpartyChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKCounterpartyChannelTransactionParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) { + LDKNodeFeatures ret_var = NodeFeatures_empty(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t pubkeys_arg, int16_t selected_contest_delay_arg) { - LDKChannelPublicKeys pubkeys_arg_conv; - pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); - pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); - pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); - LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv *env, jclass clz) { + LDKNodeFeatures ret_var = NodeFeatures_known(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37837,33 +40024,30 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact return ret_ref; } -static inline uintptr_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { - LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; } + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) { + LDKChannelFeatures ret_var = ChannelFeatures_empty(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCounterpartyChannelTransactionParameters arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCounterpartyChannelTransactionParameters orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIEnv *env, jclass clz) { + LDKChannelFeatures ret_var = ChannelFeatures_known(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37875,21 +40059,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv); + jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTransactionParameters this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_empty(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37901,12 +40081,30 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTransactionParameters this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_known(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); + jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -37918,1469 +40116,1215 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCounterpartyChannelTransactionParameters obj_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known(JNIEnv *env, jclass clz) { + LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known(); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInitFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); + 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_CounterpartyChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref); + 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 (int64_t)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelTransactionParameters obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); + 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 (int64_t)ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKNodeFeatures obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + 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 (int64_t)ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceFeatures obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, 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_InvoiceFeatures_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_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); + *ret_conv = InvoiceFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (int64_t)ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKChannelTypeFeatures obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + 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_ChannelTransactionParameters_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_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = ChannelTransactionParameters_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +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 (int64_t)ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_data_loss_protect_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_data_loss_protect_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_data_loss_protect_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDirectedChannelTransactionParameters this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DirectedChannelTransactionParameters_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_data_loss_protect_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv); + return ret_conv; } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); - return ret_conv; + InitFeatures_set_initial_routing_sync_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + InitFeatures_set_initial_routing_sync_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelTransactionParameters this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv); + jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKHolderCommitmentTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - HolderCommitmentTransaction_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKSignature val_ref; - CHECK((*env)->GetArrayLength(env, val) == 64); - (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); - HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) { - LDKHolderCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKCVec_SignatureZ val_constr; - val_constr.datalen = (*env)->GetArrayLength(env, val); - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - val_constr.data = NULL; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i); - LDKSignature val_conv_8_ref; - CHECK((*env)->GetArrayLength(env, val_conv_8) == 64); - (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form); - val_constr.data[i] = val_conv_8_ref; - } - HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv); } -static inline uintptr_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKHolderCommitmentTransaction arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKHolderCommitmentTransaction orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKHolderCommitmentTransaction obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = HolderCommitmentTransaction_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_gossip_queries_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new(JNIEnv *env, jclass clz, int64_t commitment_tx, int8_tArray counterparty_sig, jobjectArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { - LDKCommitmentTransaction commitment_tx_conv; - commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); - commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); - commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); - LDKSignature counterparty_sig_ref; - CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64); - (*env)->GetByteArrayRegion(env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form); - LDKCVec_SignatureZ counterparty_htlc_sigs_constr; - counterparty_htlc_sigs_constr.datalen = (*env)->GetArrayLength(env, counterparty_htlc_sigs); - if (counterparty_htlc_sigs_constr.datalen > 0) - counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); - else - counterparty_htlc_sigs_constr.data = NULL; - for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) { - int8_tArray counterparty_htlc_sigs_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i); - LDKSignature counterparty_htlc_sigs_conv_8_ref; - CHECK((*env)->GetArrayLength(env, counterparty_htlc_sigs_conv_8) == 64); - (*env)->GetByteArrayRegion(env, counterparty_htlc_sigs_conv_8, 0, 64, counterparty_htlc_sigs_conv_8_ref.compact_form); - counterparty_htlc_sigs_constr.data[i] = counterparty_htlc_sigs_conv_8_ref; - } - LDKPublicKey holder_funding_key_ref; - CHECK((*env)->GetArrayLength(env, holder_funding_key) == 33); - (*env)->GetByteArrayRegion(env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form); - LDKPublicKey counterparty_funding_key_ref; - CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33); - (*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form); - LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_gossip_queries_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBuiltCommitmentTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BuiltCommitmentTransaction_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBuiltCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&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); - Transaction_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_gossip_queries_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBuiltCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKTransaction val_ref; - val_ref.datalen = (*env)->GetArrayLength(env, val); - val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data); - val_ref.data_is_owned = true; - BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_gossip_queries_required(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKBuiltCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv)); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { - LDKBuiltCommitmentTransaction this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - LDKThirtyTwoBytes val_ref; - CHECK((*env)->GetArrayLength(env, val) == 32); - (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); - BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new(JNIEnv *env, jclass clz, int8_tArray transaction_arg, int8_tArray txid_arg) { - LDKTransaction transaction_arg_ref; - transaction_arg_ref.datalen = (*env)->GetArrayLength(env, transaction_arg); - transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, transaction_arg, 0, transaction_arg_ref.datalen, transaction_arg_ref.data); - transaction_arg_ref.data_is_owned = true; - LDKThirtyTwoBytes txid_arg_ref; - CHECK((*env)->GetArrayLength(env, txid_arg) == 32); - (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data); - LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv); + return ret_conv; } -static inline uintptr_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { - LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_variable_length_onion_optional(&this_arg_conv); } - return ret_ref; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_variable_length_onion_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBuiltCommitmentTransaction arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBuiltCommitmentTransaction orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_variable_length_onion_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBuiltCommitmentTransaction obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_variable_length_onion_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_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_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = BuiltCommitmentTransaction_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKBuiltCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); - funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data); - (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); - return ret_arr; + InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKBuiltCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char funding_key_arr[32]; - CHECK((*env)->GetArrayLength(env, funding_key) == 32); - (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); - unsigned char (*funding_key_ref)[32] = &funding_key_arr; - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); - funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); - (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); - return ret_arr; + InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKClosingTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ClosingTransaction_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv); + return ret_conv; } -static inline uintptr_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { - LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKClosingTransaction arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKClosingTransaction orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKClosingTransaction o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = ClosingTransaction_hash(&o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) { - LDKCVec_u8Z to_holder_script_ref; - to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script); - to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data); - LDKCVec_u8Z to_counterparty_script_ref; - to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script); - to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data); - LDKOutPoint funding_outpoint_conv; - funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); - funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); - funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); - LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_static_remote_key_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_static_remote_key_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_outpoint) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKOutPoint funding_outpoint_conv; - funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); - funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); - funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); - LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); - *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); - return (int64_t)ret_conv; + NodeFeatures_set_static_remote_key_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv); - return ret_conv; + NodeFeatures_set_static_remote_key_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; + ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKClosingTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - return ret_arr; + ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKTrustedClosingTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TrustedClosingTransaction_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - Transaction_free(ret_var); - return ret_arr; + jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1get_1sighash_1all(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKTrustedClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); - funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data); - (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); - return ret_arr; + jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { - LDKTrustedClosingTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char funding_key_arr[32]; - CHECK((*env)->GetArrayLength(env, funding_key) == 32); - (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); - unsigned char (*funding_key_ref)[32] = &funding_key_arr; - LDKu8slice funding_redeemscript_ref; - funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); - funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); - int8_tArray ret_arr = (*env)->NewByteArray(env, 64); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form); - (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0); - return ret_arr; + jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKCommitmentTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - CommitmentTransaction_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_payment_secret_optional(&this_arg_conv); } -static inline uintptr_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { - LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_payment_secret_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCommitmentTransaction arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCommitmentTransaction orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_payment_secret_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKCommitmentTransaction obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_payment_secret_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_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_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CommitmentTransaction_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv); - return ret_conv; + InvoiceFeatures_set_payment_secret_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); + InvoiceFeatures_set_payment_secret_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); + jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv); return ret_conv; } -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters, int64_t broadcaster_keys, int64_t countersignatory_keys) { - LDKCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKDirectedChannelTransactionParameters channel_parameters_conv; - channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); - channel_parameters_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); - LDKChannelPublicKeys broadcaster_keys_conv; - broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); - broadcaster_keys_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); - LDKChannelPublicKeys countersignatory_keys_conv; - countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); - countersignatory_keys_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); - LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); - *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); - return (int64_t)ret_conv; + InitFeatures_set_basic_mpp_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKTrustedCommitmentTransaction this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - TrustedCommitmentTransaction_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_basic_mpp_required(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data); - return ret_arr; + jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + NodeFeatures_set_basic_mpp_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; + NodeFeatures_set_basic_mpp_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_base_key, int64_t channel_parameters) { - LDKTrustedCommitmentTransaction this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - unsigned char htlc_base_key_arr[32]; - CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); - (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr); - unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr; - LDKDirectedChannelTransactionParameters channel_parameters_conv; - channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); - channel_parameters_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); - LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); - *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); - return (int64_t)ret_conv; + InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transaction_1number_1obscure_1factor(JNIEnv *env, jclass clz, int8_tArray broadcaster_payment_basepoint, int8_tArray countersignatory_payment_basepoint, jboolean outbound_from_broadcaster) { - LDKPublicKey broadcaster_payment_basepoint_ref; - CHECK((*env)->GetArrayLength(env, broadcaster_payment_basepoint) == 33); - (*env)->GetByteArrayRegion(env, broadcaster_payment_basepoint, 0, 33, broadcaster_payment_basepoint_ref.compressed_form); - LDKPublicKey countersignatory_payment_basepoint_ref; - CHECK((*env)->GetArrayLength(env, countersignatory_payment_basepoint) == 33); - (*env)->GetByteArrayRegion(env, countersignatory_payment_basepoint, 0, 33, countersignatory_payment_basepoint_ref.compressed_form); - int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InvoiceFeatures_set_basic_mpp_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInitFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKInitFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKNodeFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKNodeFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKChannelFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKInvoiceFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKInvoiceFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv); return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKChannelTypeFeatures a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKChannelTypeFeatures b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv); - return ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_wumbo_optional(&this_arg_conv); } -static inline uintptr_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { - LDKInitFeatures ret_var = InitFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_wumbo_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInitFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInitFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_wumbo_optional(&this_arg_conv); } -static inline uintptr_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { - LDKNodeFeatures ret_var = NodeFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_wumbo_required(&this_arg_conv); } - return ret_ref; + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNodeFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNodeFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv); + return ret_conv; } -static inline uintptr_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { - LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); } - return ret_ref; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv); } -static inline uintptr_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { - LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKInvoiceFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv); + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKInvoiceFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } -static inline uintptr_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv); + return ret_conv; } - return ret_ref; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_channel_type_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKChannelTypeFeatures arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv); - return ret_conv; + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_channel_type_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKChannelTypeFeatures orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInitFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InitFeatures_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_channel_type_optional(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNodeFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NodeFeatures_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_channel_type_required(&this_arg_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelFeatures_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInvoiceFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InvoiceFeatures_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKChannelTypeFeatures this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelTypeFeatures_free(this_obj_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) { - LDKInitFeatures ret_var = InitFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv *env, jclass clz) { - LDKInitFeatures ret_var = InitFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) { - LDKNodeFeatures ret_var = NodeFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv *env, jclass clz) { - LDKNodeFeatures ret_var = NodeFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) { - LDKChannelFeatures ret_var = ChannelFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIEnv *env, jclass clz) { - LDKChannelFeatures ret_var = ChannelFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) { - LDKInvoiceFeatures ret_var = InvoiceFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) { - LDKInvoiceFeatures ret_var = InvoiceFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv); + return ret_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKInvoiceFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known(JNIEnv *env, jclass clz) { - LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known(); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + InitFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKChannelTypeFeatures this_arg_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv); + jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv); return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInitFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - 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 void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); - *ret_conv = InitFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); - *ret_conv = ChannelFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKNodeFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - 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 void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); - *ret_conv = NodeFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInvoiceFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInitFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_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_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); - *ret_conv = InvoiceFeatures_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKChannelTypeFeatures obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - 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 jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelTypeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv); + return ret_conv; } -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 (int64_t)ret_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_keysend_optional(&this_arg_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NodeFeatures_set_keysend_required(&this_arg_conv); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNodeFeatures this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv); + return ret_conv; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -39572,11 +41516,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh( } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) { + LDKu8slice program_ref; program_ref.datalen = (*env)->GetArrayLength(env, program); program_ref.data = (*env)->GetByteArrayElements (env, program, NULL); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = ShutdownScript_new_witness_program(version, program_ref); + *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref); (*env)->ReleaseByteArrayElements(env, program, (int8_t*)program_ref.data, 0); return (int64_t)ret_conv; } @@ -39769,44 +41714,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env NetworkGraph_free(this_obj_conv); } -static inline uintptr_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) { - LDKNetworkGraph ret_var = NetworkGraph_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKNetworkGraph arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = NetworkGraph_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKNetworkGraph orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKReadOnlyNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); @@ -39856,9 +41763,9 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1upd return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1closed(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) { LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); - *ret_copy = NetworkUpdate_channel_closed(short_channel_id, is_permanent); + *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent); int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -39892,25 +41799,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetGraphMsgHandler this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); - *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKNetGraphMsgHandler this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKP2PGossipSync this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - NetGraphMsgHandler_free(this_obj_conv); + P2PGossipSync_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t chain_access, int64_t logger) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t chain_access, int64_t logger) { LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; @@ -39933,7 +41830,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(&network_graph_conv, chain_access_conv, logger_conv); + LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -39945,8 +41842,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain_1access(JNIEnv *env, jclass clz, int64_t this_arg, int64_t chain_access) { - LDKNetGraphMsgHandler this_arg_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1chain_1access(JNIEnv *env, jclass clz, int64_t this_arg, int64_t chain_access) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); @@ -39961,26 +41858,36 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain LDKAccess_JCalls_cloned(&chain_access_conv.some); } } - NetGraphMsgHandler_add_chain_access(&this_arg_conv, chain_access_conv); + P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetGraphMsgHandler this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); + *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv); + return (int64_t)ret_ret; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); - *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv); + *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv); return (int64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKNetGraphMsgHandler this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKP2PGossipSync this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); + *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv); return (int64_t)ret_ret; } @@ -40487,6 +42394,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv * return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info(JNIEnv *env, jclass clz, int64_t this_arg, int8_t channel_flags) { + LDKChannelInfo this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags); + int64_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + } + return ret_ref; +} + JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) { LDKChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); @@ -40591,6 +42517,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1direct return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDirectedChannelInfo this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv); + return ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) { LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -41265,21 +43200,35 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNI return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); + CHECK_ACCESS(arg_ptr); + LDKLogger arg_conv = *(LDKLogger*)(arg_ptr); + if (arg_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_conv); + } LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); - *ret_conv = NetworkGraph_read(ser_ref); + *ret_conv = NetworkGraph_read(ser_ref, arg_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, int8_tArray genesis_hash) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, int8_tArray genesis_hash, int64_t logger) { LDKThirtyTwoBytes genesis_hash_ref; CHECK((*env)->GetArrayLength(env, genesis_hash) == 32); (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_ref.data); - LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -41308,6 +43257,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JN return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg, int32_t last_rapid_gossip_sync_timestamp) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_1from_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -41386,15 +43354,36 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1from_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, jboolean is_permanent) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t timestamp, int64_t features, int8_tArray node_id_1, int8_tArray node_id_2) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent); + LDKChannelFeatures features_conv; + features_conv.inner = (void*)(features & (~1)); + features_conv.is_owned = (features & 1) || (features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); + features_conv = ChannelFeatures_clone(&features_conv); + LDKPublicKey node_id_1_ref; + CHECK((*env)->GetArrayLength(env, node_id_1) == 33); + (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form); + LDKPublicKey node_id_2_ref; + CHECK((*env)->GetArrayLength(env, node_id_2) == 33); + (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form); + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = NetworkGraph_add_channel_from_partial_announcement(&this_arg_conv, short_channel_id, timestamp, features_conv, node_id_1_ref, node_id_2_ref); + return (int64_t)ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray _node_id, jboolean is_permanent) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, jboolean is_permanent) { + LDKNetworkGraph this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray _node_id, jboolean is_permanent) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; @@ -41402,7 +43391,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node(JNIEn LDKPublicKey _node_id_ref; CHECK((*env)->GetArrayLength(env, _node_id) == 33); (*env)->GetByteArrayRegion(env, _node_id, 0, 33, _node_id_ref.compressed_form); - NetworkGraph_fail_node(&this_arg_conv, _node_id_ref, is_permanent); + NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -42845,7 +44834,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv * return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t route_params, int64_t network, int64_tArray first_hops, int64_t logger, int64_t scorer, int8_tArray random_seed_bytes) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t route_params, int64_t network_graph, int64_tArray first_hops, int64_t logger, int64_t scorer, int8_tArray random_seed_bytes) { LDKPublicKey our_node_pubkey_ref; CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); @@ -42853,10 +44842,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc route_params_conv.inner = (void*)(route_params & (~1)); route_params_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - LDKNetworkGraph network_conv; - network_conv.inner = (void*)(network & (~1)); - network_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_conv); + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = (void*)(network_graph & (~1)); + network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -42892,11 +44881,52 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_conv, first_hops_ptr, logger_conv, scorer_conv, random_seed_bytes_ref); + *ret_conv = find_route(our_node_pubkey_ref, &route_params_conv, &network_graph_conv, first_hops_ptr, logger_conv, scorer_conv, random_seed_bytes_ref); if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } return (int64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, jobjectArray hops, int64_t route_params, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes) { + LDKPublicKey our_node_pubkey_ref; + CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33); + (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form); + LDKCVec_PublicKeyZ hops_constr; + hops_constr.datalen = (*env)->GetArrayLength(env, hops); + if (hops_constr.datalen > 0) + hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + hops_constr.data = NULL; + for (size_t i = 0; i < hops_constr.datalen; i++) { + int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i); + LDKPublicKey hops_conv_8_ref; + CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33); + (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form); + hops_constr.data[i] = hops_conv_8_ref; + } + LDKRouteParameters route_params_conv; + route_params_conv.inner = (void*)(route_params & (~1)); + route_params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = (void*)(network_graph & (~1)); + network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + 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); + } + unsigned char random_seed_bytes_arr[32]; + CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); + (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr); + unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr; + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref); + return (int64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); @@ -42923,6 +44953,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1fr MultiThreadedLockableScore_free(this_obj_conv); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKMultiThreadedLockableScore obj_conv; + obj_conv.inner = (void*)(obj & (~1)); + obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) { void* score_ptr = (void*)(((uintptr_t)score) & ~1); CHECK_ACCESS(score_ptr); @@ -42943,200 +44985,77 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_ return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKFixedPenaltyScorer this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - FixedPenaltyScorer_free(this_obj_conv); -} - -static inline uintptr_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKFixedPenaltyScorer arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKFixedPenaltyScorer orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) { - LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKFixedPenaltyScorer this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv); - return (int64_t)ret_ret; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKFixedPenaltyScorer obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); - *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKScorer this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKChannelUsage this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Scorer_free(this_obj_conv); + ChannelUsage_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKScoringParameters this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ScoringParameters_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ScoringParameters_get_base_penalty_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val); + ChannelUsage_set_amount_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv); + int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val); + ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val); } -JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1start_11024th(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int16_t ret_conv = ScoringParameters_get_overuse_penalty_start_1024th(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1start_11024th(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { - LDKScoringParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_overuse_penalty_start_1024th(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1msat_1per_11024th(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ScoringParameters_get_overuse_penalty_msat_per_1024th(&this_ptr_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1msat_1per_11024th(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKScoringParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_overuse_penalty_msat_per_1024th(&this_ptr_conv, val); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKScoringParameters this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv); - return ret_conv; + LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); + *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKScoringParameters this_ptr_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelUsage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); + CHECK_ACCESS(val_ptr); + LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr); + val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)(((uintptr_t)val) & ~1)); + ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIEnv *env, jclass clz, int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int16_t overuse_penalty_start_1024th_arg, int64_t overuse_penalty_msat_per_1024th_arg, int64_t failure_penalty_half_life_arg) { - LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new(JNIEnv *env, jclass clz, int64_t amount_msat_arg, int64_t inflight_htlc_msat_arg, int64_t effective_capacity_arg) { + void* effective_capacity_arg_ptr = (void*)(((uintptr_t)effective_capacity_arg) & ~1); + CHECK_ACCESS(effective_capacity_arg_ptr); + LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr); + effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)(((uintptr_t)effective_capacity_arg) & ~1)); + LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43148,8 +45067,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIE return ret_ref; } -static inline uintptr_t ScoringParameters_clone_ptr(LDKScoringParameters *NONNULL_PTR arg) { - LDKScoringParameters ret_var = ScoringParameters_clone(arg); +static inline uintptr_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) { + LDKChannelUsage ret_var = ChannelUsage_clone(arg); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43160,21 +45079,21 @@ if (ret_var.is_owned) { } return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKScoringParameters arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUsage arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = ScoringParameters_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKScoringParameters orig_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKChannelUsage orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKScoringParameters ret_var = ScoringParameters_clone(&orig_conv); + LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43186,48 +45105,41 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1clone(JN return ret_ref; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKScoringParameters obj_conv; - obj_conv.inner = (void*)(obj & (~1)); - obj_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, 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_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKFixedPenaltyScorer this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + FixedPenaltyScorer_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_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_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); - *ret_conv = ScoringParameters_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return (int64_t)ret_conv; +static inline uintptr_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg); +int64_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +ret_ref = (uintptr_t)ret_var.inner; +if (ret_var.is_owned) { + ret_ref |= 1; } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1new(JNIEnv *env, jclass clz, int64_t params) { - LDKScoringParameters params_conv; - params_conv.inner = (void*)(params & (~1)); - params_conv.is_owned = (params & 1) || (params == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); - params_conv = ScoringParameters_clone(¶ms_conv); - LDKScorer ret_var = Scorer_new(params_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFixedPenaltyScorer arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv); + return ret_conv; +} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env, jclass clz) { - LDKScorer ret_var = Scorer_default(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKFixedPenaltyScorer orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43239,8 +45151,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default(JNIEnv *env, jclass clz) { - LDKScoringParameters ret_var = ScoringParameters_default(); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) { + LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43252,34 +45164,34 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default( return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKScorer this_arg_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKFixedPenaltyScorer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); - *ret_ret = Scorer_as_Score(&this_arg_conv); + *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv); return (int64_t)ret_ret; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKScorer obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKFixedPenaltyScorer obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - LDKCVec_u8Z ret_var = Scorer_write(&obj_conv); + LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); - *ret_conv = Scorer_read(ser_ref); + LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ"); + *ret_conv = FixedPenaltyScorer_read(ser_ref, arg); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } @@ -43419,7 +45331,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParamet return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JNIEnv *env, jclass clz, int64_t params, int64_t network_graph) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JNIEnv *env, jclass clz, int64_t params, int64_t network_graph, int64_t logger) { LDKProbabilisticScoringParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); @@ -43429,7 +45341,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JN network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -43441,6 +45360,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new(JN return ret_ref; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKProbabilisticScorer this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1default(JNIEnv *env, jclass clz) { LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default(); int64_t ret_ref = 0; @@ -43476,7 +45403,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1wr return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); @@ -43489,8 +45416,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(J arg_b_conv.inner = (void*)(arg_b & (~1)); arg_b_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv); + void* arg_c_ptr = (void*)(((uintptr_t)arg_c) & ~1); + CHECK_ACCESS(arg_c_ptr); + LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr); + if (arg_c_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&arg_c_conv); + } LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ"); - *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv); + *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return (int64_t)ret_conv; } @@ -43528,28 +45462,6 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1d return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persist_1manager(JNIEnv *env, jclass clz, jstring data_dir, int64_t manager) { - LDKStr data_dir_conv = java_to_owned_str(env, data_dir); - LDKChannelManager manager_conv; - manager_conv.inner = (void*)(manager & (~1)); - manager_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(manager_conv); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = FilesystemPersister_persist_manager(data_dir_conv, &manager_conv); - return (int64_t)ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persist_1network_1graph(JNIEnv *env, jclass clz, jstring data_dir, int64_t network_graph) { - LDKStr data_dir_conv = java_to_owned_str(env, data_dir); - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = (void*)(network_graph & (~1)); - network_graph_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); - *ret_conv = FilesystemPersister_persist_network_graph(data_dir_conv, &network_graph_conv); - return (int64_t)ret_conv; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1channelmonitors(JNIEnv *env, jclass clz, int64_t this_arg, int64_t keys_manager) { LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); @@ -43567,16 +45479,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1 return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1as_1Persist(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKFilesystemPersister this_arg_conv; - this_arg_conv.inner = (void*)(this_arg & (~1)); - this_arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); - *ret_ret = FilesystemPersister_as_Persist(&this_arg_conv); - return (int64_t)ret_ret; -} - 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 = (void*)(this_obj & (~1)); @@ -43585,16 +45487,45 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIE BackgroundProcessor_free(this_obj_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipSync_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); - LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); + LDKGossipSync this_ptr_conv = *(LDKGossipSync*)(this_ptr_ptr); FREE((void*)this_ptr); - Persister_free(this_ptr_conv); + GossipSync_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t net_graph_msg_handler, int64_t peer_manager, int64_t logger) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1p2_1p(JNIEnv *env, jclass clz, int64_t a) { + LDKP2PGossipSync a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync"); + *ret_copy = GossipSync_p2_p(&a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1rapid(JNIEnv *env, jclass clz, int64_t a) { + LDKRapidGossipSync a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync"); + *ret_copy = GossipSync_rapid(&a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1none(JNIEnv *env, jclass clz) { + LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync"); + *ret_copy = GossipSync_none(); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t gossip_sync, int64_t peer_manager, int64_t logger, int64_t scorer) { void* persister_ptr = (void*)(((uintptr_t)persister) & ~1); CHECK_ACCESS(persister_ptr); LDKPersister persister_conv = *(LDKPersister*)(persister_ptr); @@ -43617,10 +45548,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); - LDKNetGraphMsgHandler net_graph_msg_handler_conv; - net_graph_msg_handler_conv.inner = (void*)(net_graph_msg_handler & (~1)); - net_graph_msg_handler_conv.is_owned = (net_graph_msg_handler & 1) || (net_graph_msg_handler == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(net_graph_msg_handler_conv); + void* gossip_sync_ptr = (void*)(((uintptr_t)gossip_sync) & ~1); + CHECK_ACCESS(gossip_sync_ptr); + LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr); + // WARNING: we may need a move here but no clone is available for LDKGossipSync LDKPeerManager peer_manager_conv; peer_manager_conv.inner = (void*)(peer_manager & (~1)); peer_manager_conv.is_owned = false; @@ -43632,7 +45563,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, net_graph_msg_handler_conv, &peer_manager_conv, logger_conv); + LDKMultiThreadedLockableScore scorer_conv; + scorer_conv.inner = (void*)(scorer & (~1)); + scorer_conv.is_owned = (scorer & 1) || (scorer == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv); + LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, gossip_sync_conv, &peer_manager_conv, logger_conv, scorer_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -45759,101 +47694,59 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jcla Router_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKRetryAttempts this_obj_conv; - this_obj_conv.inner = (void*)(this_obj & (~1)); - this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - RetryAttempts_free(this_obj_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr); + FREE((void*)this_ptr); + Retry_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { - LDKRetryAttempts this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int64_t ret_conv = RetryAttempts_get_a(&this_ptr_conv); - return ret_conv; +static inline uintptr_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { - LDKRetryAttempts this_ptr_conv; - this_ptr_conv.inner = (void*)(this_ptr & (~1)); - this_ptr_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - RetryAttempts_set_a(&this_ptr_conv, val); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRetry* arg_conv = (LDKRetry*)arg; + int64_t ret_conv = Retry_clone_ptr(arg_conv); + return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv *env, jclass clz, int64_t a_arg) { - LDKRetryAttempts ret_var = RetryAttempts_new(a_arg); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRetry* orig_conv = (LDKRetry*)orig; + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -static inline uintptr_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg) { - LDKRetryAttempts ret_var = RetryAttempts_clone(arg); -int64_t ret_ref = 0; -CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. -CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uintptr_t)ret_var.inner; -if (ret_var.is_owned) { - ret_ref |= 1; -} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int64_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_attempts(a); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKRetryAttempts arg_conv; - arg_conv.inner = (void*)(arg & (~1)); - arg_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_conv = RetryAttempts_clone_ptr(&arg_conv); - return ret_conv; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKRetryAttempts orig_conv; - orig_conv.inner = (void*)(orig & (~1)); - orig_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); - LDKRetryAttempts ret_var = RetryAttempts_clone(&orig_conv); - int64_t ret_ref = 0; - CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uintptr_t)ret_var.inner; - if (ret_var.is_owned) { - ret_ref |= 1; - } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) { + LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry"); + *ret_copy = Retry_timeout(a); + int64_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { - LDKRetryAttempts a_conv; - a_conv.inner = (void*)(a & (~1)); - a_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - LDKRetryAttempts b_conv; - b_conv.inner = (void*)(b & (~1)); - b_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - jboolean ret_conv = RetryAttempts_eq(&a_conv, &b_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKRetry* a_conv = (LDKRetry*)a; + LDKRetry* b_conv = (LDKRetry*)b; + jboolean ret_conv = Retry_eq(a_conv, b_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash(JNIEnv *env, jclass clz, int64_t o) { - LDKRetryAttempts o_conv; - o_conv.inner = (void*)(o & (~1)); - o_conv.is_owned = false; - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - int64_t ret_conv = RetryAttempts_hash(&o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKRetry* o_conv = (LDKRetry*)o; + int64_t ret_conv = Retry_hash(o_conv); return ret_conv; } @@ -45917,7 +47810,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1sending(JNIEn return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *env, jclass clz, int64_t payer, int64_t router, int64_t scorer, int64_t logger, int64_t event_handler, int64_t retry_attempts) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *env, jclass clz, int64_t payer, int64_t router, int64_t scorer, int64_t logger, int64_t event_handler, int64_t retry) { void* payer_ptr = (void*)(((uintptr_t)payer) & ~1); CHECK_ACCESS(payer_ptr); LDKPayer payer_conv = *(LDKPayer*)(payer_ptr); @@ -45950,12 +47843,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKEventHandler_JCalls_cloned(&event_handler_conv); } - LDKRetryAttempts retry_attempts_conv; - retry_attempts_conv.inner = (void*)(retry_attempts & (~1)); - retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0); - CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_attempts_conv); - retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv); - LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_conv); + void* retry_ptr = (void*)(((uintptr_t)retry) & ~1); + CHECK_ACCESS(retry_ptr); + LDKRetry retry_conv = *(LDKRetry*)(retry_ptr); + retry_conv = Retry_clone((LDKRetry*)(((uintptr_t)retry) & ~1)); + LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_conv); int64_t ret_ref = 0; CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -46033,18 +47925,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHand return (int64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, jstring description, int8_tArray payment_hash, int8_tArray payment_secret, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) { void* amt_msat_ptr = (void*)(((uintptr_t)amt_msat) & ~1); CHECK_ACCESS(amt_msat_ptr); LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)amt_msat) & ~1)); - LDKStr description_conv = java_to_owned_str(env, description); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); + LDKStr description_conv = java_to_owned_str(env, description); LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); if (phantom_route_hints_constr.datalen > 0) @@ -46071,26 +47960,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JN } LDKCurrency network_conv = LDKCurrency_from_java(env, network); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice(amt_msat_conv, description_conv, payment_hash_ref, payment_secret_ref, phantom_route_hints_constr, keys_manager_conv, network_conv); + *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, keys_manager_conv, network_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int64_t description_hash, int8_tArray payment_hash, int8_tArray payment_secret, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) { void* amt_msat_ptr = (void*)(((uintptr_t)amt_msat) & ~1); CHECK_ACCESS(amt_msat_ptr); LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)amt_msat) & ~1)); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); LDKSha256 description_hash_conv; description_hash_conv.inner = (void*)(description_hash & (~1)); description_hash_conv.is_owned = (description_hash & 1) || (description_hash == 0); 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); - LDKThirtyTwoBytes payment_secret_ref; - CHECK((*env)->GetArrayLength(env, payment_secret) == 32); - (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data); LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr; phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints); if (phantom_route_hints_constr.datalen > 0) @@ -46117,11 +48003,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1w } LDKCurrency network_conv = LDKCurrency_from_java(env, network); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, description_hash_conv, payment_hash_ref, payment_secret_ref, phantom_route_hints_constr, keys_manager_conv, network_conv); + *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, keys_manager_conv, network_conv); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; @@ -46140,11 +48026,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)amt_msat) & ~1)); LDKStr description_conv = java_to_owned_str(env, description); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv); + *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, int64_t description_hash) { +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 keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; @@ -46167,11 +48053,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); description_hash_conv = Sha256_clone(&description_hash_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv); + *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch) { +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 keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; @@ -46194,11 +48080,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv); description_hash_conv = Sha256_clone(&description_hash_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch); + *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs); return (int64_t)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch) { +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 keys_manager, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) { LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; @@ -46217,7 +48103,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)amt_msat) & ~1)); LDKStr description_conv = java_to_owned_str(env, description); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); - *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs); return (int64_t)ret_conv; } @@ -46351,3 +48237,115 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str(JNIEnv *e return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRapidGossipSync this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + RapidGossipSync_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = (void*)(network_graph & (~1)); + network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + LDKRapidGossipSync ret_var = RapidGossipSync_new(&network_graph_conv); + int64_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uintptr_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1sync_1network_1graph_1with_1file_1path(JNIEnv *env, jclass clz, int64_t this_arg, jstring sync_path) { + LDKRapidGossipSync this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKStr sync_path_conv = java_to_owned_str(env, sync_path); + LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ"); + *ret_conv = RapidGossipSync_sync_network_graph_with_file_path(&this_arg_conv, sync_path_conv); + return (int64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1is_1initial_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKRapidGossipSync this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + jboolean ret_conv = RapidGossipSync_is_initial_sync_complete(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if ((this_ptr & 1) != 0) return; + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); + CHECK_ACCESS(this_ptr_ptr); + LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr); + FREE((void*)this_ptr); + GraphSyncError_free(this_ptr_conv); +} + +static inline uintptr_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) { + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_clone(arg); +int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)arg; + int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)orig; + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_clone(orig_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1decode_1error(JNIEnv *env, jclass clz, int64_t a) { + LDKDecodeError a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = DecodeError_clone(&a_conv); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_decode_error(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1lightning_1error(JNIEnv *env, jclass clz, int64_t a) { + LDKLightningError a_conv; + a_conv.inner = (void*)(a & (~1)); + a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = LightningError_clone(&a_conv); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = GraphSyncError_lightning_error(a_conv); + int64_t ret_ref = (uintptr_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray update_data) { + LDKRapidGossipSync this_arg_conv; + this_arg_conv.inner = (void*)(this_arg & (~1)); + this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + LDKu8slice update_data_ref; + update_data_ref.datalen = (*env)->GetArrayLength(env, update_data); + update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL); + LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ"); + *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref); + (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0); + return (int64_t)ret_conv; +} + diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index 275cb5cd..2c0ee42d 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -593,66 +593,26 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/AccessError; + * Method: LDKPaymentPurpose_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKPaymentPurpose; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_usizeTransactionZ_get_a + * Method: CResult_PaymentPurposeDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C2Tuple_usizeTransactionZ_get_b - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_get_ok - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_get_err - * Signature: (J)Lorg/ldk/enums/ChannelMonitorUpdateErr; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKMonitorEvent_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKMonitorEvent; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_usizeTransactionZZ; + * Method: CResult_PaymentPurposeDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeTransactionZZ_1ref_1from_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -711,14 +671,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetworkUpdateZ_ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKPaymentPurpose_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKPaymentPurpose; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKEvent_ref_from_ptr @@ -769,52 +721,108 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f /* * Class: org_ldk_impl_bindings - * Method: CResult_FixedPenaltyScorerDecodeErrorZ_get_ok + * Method: CResult_TxOutAccessErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FixedPenaltyScorerDecodeErrorZ_get_err - * Signature: (J)J + * Method: CResult_TxOutAccessErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/AccessError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScoringParametersDecodeErrorZ_get_ok + * Method: C2Tuple_usizeTransactionZ_get_a * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_usizeTransactionZ_get_b + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneChannelMonitorUpdateErrZ_get_ok + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneChannelMonitorUpdateErrZ_get_err + * Signature: (J)Lorg/ldk/enums/ChannelMonitorUpdateErr; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKMonitorEvent_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKMonitorEvent; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScoringParametersDecodeErrorZ_get_err + * Method: C2Tuple_OutPointCVec_MonitorEventZZ_get_a * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_MonitorEventZZ_get_b + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_C2Tuple_usizeTransactionZZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeTransactionZZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScorerDecodeErrorZ_get_ok + * Method: CResult_FixedPenaltyScorerDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScorerDecodeErrorZ_get_err + * Method: CResult_FixedPenaltyScorerDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKLogger_new + * Signature: (Lorg/ldk/impl/bindings/LDKLogger;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new + (JNIEnv *, jclass, jobject); + /* * Class: org_ldk_impl_bindings * Method: CResult_ProbabilisticScorerDecodeErrorZ_get_ok @@ -913,176 +921,400 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesD /* * Class: org_ldk_impl_bindings - * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok + * Method: CResult_NodeIdDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err + * Method: CResult_NodeIdDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok - * Signature: (J)J + * Method: LDKAccess_new + * Signature: (Lorg/ldk/impl/bindings/LDKAccess;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_get_err - * Signature: (J)J + * Method: Access_get_utxo + * Signature: (J[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureCVec_SignatureZZ_get_a - * Signature: (J)[B + * Method: LDKCOption_AccessZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_AccessZ; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureCVec_SignatureZZ_get_b - * Signature: (J)[[B + * Method: CResult_boolLightningErrorZ_get_ok + * Signature: (J)Z */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok + * Method: CResult_boolLightningErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err - * Signature: (J)V + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_get_ok - * Signature: (J)[B + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_get_err - * Signature: (J)V + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureSignatureZ_get_a - * Signature: (J)[B + * Method: CResult_NoneLightningErrorZ_get_ok + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1a +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureSignatureZ_get_b - * Signature: (J)[B + * Method: CResult_NoneLightningErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1b +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok + * Method: CResult_ChannelUpdateInfoDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_get_err - * Signature: (J)V + * Method: CResult_ChannelUpdateInfoDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyNoneZ_get_ok - * Signature: (J)[B + * Method: CResult_ChannelInfoDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyNoneZ_get_err - * Signature: (J)V + * Method: CResult_ChannelInfoDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKBaseSign_new - * Signature: (Lorg/ldk/impl/bindings/LDKBaseSign;J)J + * Method: CResult_RoutingFeesDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKBaseSign_1new - (JNIEnv *, jclass, jobject, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BaseSign_get_per_commitment_point - * Signature: (JJ)[B + * Method: CResult_RoutingFeesDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1per_1commitment_1point - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BaseSign_release_commitment_secret - * Signature: (JJ)[B + * Method: LDKNetAddress_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKNetAddress; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1release_1commitment_1secret - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BaseSign_validate_holder_commitment - * Signature: (JJ[[B)J + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeInfoDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeInfoDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetworkGraphDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NetworkGraphDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_CVec_NetAddressZZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_CVec_NetAddressZZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_SignatureCVec_SignatureZZ_get_a + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_SignatureCVec_SignatureZZ_get_b + * Signature: (J)[[B + */ +JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignatureNoneZ_get_ok + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignatureNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_SignatureSignatureZ_get_a + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_SignatureSignatureZ_get_b + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1get_1b + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SecretKeyNoneZ_get_ok + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SecretKeyNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKBaseSign_new + * Signature: (Lorg/ldk/impl/bindings/LDKBaseSign;J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKBaseSign_1new + (JNIEnv *, jclass, jobject, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BaseSign_get_per_commitment_point + * Signature: (JJ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1per_1commitment_1point + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BaseSign_release_commitment_secret + * Signature: (JJ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1release_1commitment_1secret + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BaseSign_validate_holder_commitment + * Signature: (JJ[[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1holder_1commitment (JNIEnv *, jclass, jlong, jlong, jobjectArray); @@ -1431,14 +1663,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHash JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKNetAddress_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKNetAddress; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: C2Tuple_PaymentHashPaymentSecretZ_get_a @@ -1735,14 +1959,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight (JNIEnv *, jclass, jlong, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKLogger_new - * Signature: (Lorg/ldk/impl/bindings/LDKLogger;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new - (JNIEnv *, jclass, jobject); - /* * Class: org_ldk_impl_bindings * Method: C2Tuple_BlockHashChannelManagerZ_get_a @@ -2249,80 +2465,24 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashCh /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneLightningErrorZ_get_ok - * Signature: (J)V + * Method: C2Tuple_PublicKeyTypeZ_get_a + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneLightningErrorZ_get_err + * Method: C2Tuple_PublicKeyTypeZ_get_b * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_get_a - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1a - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_get_b - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_get_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCOption_NetAddressZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_NetAddressZ; + * Method: LDKCOption_NetAddressZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_NetAddressZ; */ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetAddressZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); @@ -2377,162 +2537,26 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeIdDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeIdDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKAccess_new - * Signature: (Lorg/ldk/impl/bindings/LDKAccess;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: Access_get_utxo - * Signature: (J[BJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo - (JNIEnv *, jclass, jlong, jbyteArray, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCOption_AccessZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_AccessZ; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelUpdateInfoDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelUpdateInfoDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelInfoDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelInfoDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_RoutingFeesDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_RoutingFeesDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeInfoDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeInfoDecodeErrorZ_get_err - * Signature: (J)J + * Method: LDKGraphSyncError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKGraphSyncError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NetworkGraphDecodeErrorZ_get_ok - * Signature: (J)J + * Method: CResult_u32GraphSyncErrorZ_get_ok + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NetworkGraphDecodeErrorZ_get_err + * Method: CResult_u32GraphSyncErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKCOption_CVec_NetAddressZZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_CVec_NetAddressZZ; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -2681,18 +2705,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeE /* * Class: org_ldk_impl_bindings - * Method: CResult_FundingLockedDecodeErrorZ_get_ok + * Method: CResult_ChannelReadyDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FundingLockedDecodeErrorZ_get_err + * Method: CResult_ChannelReadyDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -3201,63 +3225,143 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pendi /* * Class: org_ldk_impl_bindings - * Method: LDKListen_new - * Signature: (Lorg/ldk/impl/bindings/LDKListen;)J + * Method: LDKScore_new + * Signature: (Lorg/ldk/impl/bindings/LDKScore;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKListen_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKScore_1new (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: Listen_block_connected - * Signature: (J[BI)V + * Method: Score_channel_penalty_msat + * Signature: (JJJJJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected - (JNIEnv *, jclass, jlong, jbyteArray, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Listen_block_disconnected - * Signature: (J[BI)V + * Method: Score_payment_path_failed + * Signature: (J[JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected - (JNIEnv *, jclass, jlong, jbyteArray, jint); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed + (JNIEnv *, jclass, jlong, jlongArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKConfirm_new - * Signature: (Lorg/ldk/impl/bindings/LDKConfirm;)J + * Method: Score_payment_path_successful + * Signature: (J[J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new - (JNIEnv *, jclass, jobject); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: Confirm_transactions_confirmed - * Signature: (J[B[JI)V + * Method: Score_write + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transactions_1confirmed - (JNIEnv *, jclass, jlong, jbyteArray, jlongArray, jint); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Score_1write + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Confirm_transaction_unconfirmed - * Signature: (J[B)V + * Method: LDKPersister_new + * Signature: (Lorg/ldk/impl/bindings/LDKPersister;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: Confirm_best_block_updated - * Signature: (J[BI)V + * Method: Persister_persist_manager + * Signature: (JJ)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated - (JNIEnv *, jclass, jlong, jbyteArray, jint); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Confirm_get_relevant_txids + * Method: Persister_persist_graph + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Persister_persist_scorer + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1scorer + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKListen_new + * Signature: (Lorg/ldk/impl/bindings/LDKListen;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKListen_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: Listen_filtered_block_connected + * Signature: (J[B[JI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1filtered_1block_1connected + (JNIEnv *, jclass, jlong, jbyteArray, jlongArray, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: Listen_block_connected + * Signature: (J[BI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected + (JNIEnv *, jclass, jlong, jbyteArray, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: Listen_block_disconnected + * Signature: (J[BI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected + (JNIEnv *, jclass, jlong, jbyteArray, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKConfirm_new + * Signature: (Lorg/ldk/impl/bindings/LDKConfirm;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: Confirm_transactions_confirmed + * Signature: (J[B[JI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transactions_1confirmed + (JNIEnv *, jclass, jlong, jbyteArray, jlongArray, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: Confirm_transaction_unconfirmed + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Confirm_best_block_updated + * Signature: (J[BI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated + (JNIEnv *, jclass, jlong, jbyteArray, jint); + +/* + * Class: org_ldk_impl_bindings + * Method: Confirm_get_relevant_txids * Signature: (J)[[B */ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids @@ -3337,10 +3441,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ /* * Class: org_ldk_impl_bindings - * Method: ChannelMessageHandler_handle_funding_locked + * Method: ChannelMessageHandler_handle_channel_ready * Signature: (J[BJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1ready (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* @@ -3647,46 +3751,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1from_1ptr (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKScore_new - * Signature: (Lorg/ldk/impl/bindings/LDKScore;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKScore_1new - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: Score_channel_penalty_msat - * Signature: (JJJJJJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Score_payment_path_failed - * Signature: (J[JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed - (JNIEnv *, jclass, jlong, jlongArray, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Score_payment_path_successful - * Signature: (J[J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful - (JNIEnv *, jclass, jlong, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: Score_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Score_1write - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKLockableScore_new @@ -3705,27 +3769,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock /* * Class: org_ldk_impl_bindings - * Method: LDKPersister_new - * Signature: (Lorg/ldk/impl/bindings/LDKPersister;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: Persister_persist_manager - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Persister_persist_graph - * Signature: (JJ)J + * Method: LDKGossipSync_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKGossipSync; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGossipSync_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -3807,6 +3855,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1find_1route (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlongArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKRetry_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKRetry; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: _ldk_get_compiled_version @@ -5265,554 +5321,570 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_ok - * Signature: (J)J + * Method: CVec_PublicKeyZ_free + * Signature: ([[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free + (JNIEnv *, jclass, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_err - * Signature: (Lorg/ldk/enums/AccessError;)J + * Method: CResult_PaymentPurposeDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_is_ok - * Signature: (J)Z + * Method: CResult_PaymentPurposeDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_free - * Signature: (J)V + * Method: CResult_PaymentPurposeDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_clone_ptr - * Signature: (J)J + * Method: CResult_PaymentPurposeDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxOutAccessErrorZ_clone + * Method: CResult_PaymentPurposeDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_usizeTransactionZ_clone_ptr + * Method: CResult_PaymentPurposeDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_usizeTransactionZ_clone + * Method: COption_ClosureReasonZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_usizeTransactionZ_new - * Signature: (J[B)J + * Method: COption_ClosureReasonZ_none + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_usizeTransactionZ_free + * Method: COption_ClosureReasonZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_usizeTransactionZZ_free - * Signature: ([J)V + * Method: COption_ClosureReasonZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_TxidZ_free - * Signature: ([[B)V + * Method: COption_ClosureReasonZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxidZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_ok - * Signature: ()J + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_err - * Signature: (Lorg/ldk/enums/ChannelMonitorUpdateErr;)J + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_is_ok + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_free + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_clone_ptr + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneChannelMonitorUpdateErrZ_clone + * Method: CResult_COption_ClosureReasonZDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_MonitorEventZ_free - * Signature: ([J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_C2Tuple_usizeTransactionZZ_some + * Method: COption_NetworkUpdateZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_C2Tuple_usizeTransactionZZ_none + * Method: COption_NetworkUpdateZ_none * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1none (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: COption_C2Tuple_usizeTransactionZZ_free + * Method: COption_NetworkUpdateZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_C2Tuple_usizeTransactionZZ_clone_ptr + * Method: COption_NetworkUpdateZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_C2Tuple_usizeTransactionZZ_clone + * Method: COption_NetworkUpdateZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_ClosureReasonZ_some + * Method: CVec_SpendableOutputDescriptorZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_EventZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_ClosureReasonZ_none + * Method: COption_EventZ_none * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: COption_ClosureReasonZ_free + * Method: COption_EventZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_ClosureReasonZ_clone_ptr + * Method: COption_EventZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_ClosureReasonZ_clone + * Method: COption_EventZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_ClosureReasonZDecodeErrorZ_ok + * Method: CResult_COption_EventZDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_ClosureReasonZDecodeErrorZ_err + * Method: CResult_COption_EventZDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_ClosureReasonZDecodeErrorZ_is_ok + * Method: CResult_COption_EventZDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_ClosureReasonZDecodeErrorZ_free + * Method: CResult_COption_EventZDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr + * Method: CResult_COption_EventZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_ClosureReasonZDecodeErrorZ_clone + * Method: CResult_COption_EventZDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_some + * Method: CVec_MessageSendEventZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxOutAccessErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_none - * Signature: ()J + * Method: CResult_TxOutAccessErrorZ_err + * Signature: (Lorg/ldk/enums/AccessError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1none - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_free + * Method: CResult_TxOutAccessErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_TxOutAccessErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_clone_ptr + * Method: CResult_TxOutAccessErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_clone + * Method: CResult_TxOutAccessErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_SpendableOutputDescriptorZ_free - * Signature: ([J)V + * Method: C2Tuple_usizeTransactionZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_some + * Method: C2Tuple_usizeTransactionZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_none - * Signature: ()J + * Method: C2Tuple_usizeTransactionZ_new + * Signature: (J[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_free + * Method: C2Tuple_usizeTransactionZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_clone_ptr - * Signature: (J)J + * Method: CVec_C2Tuple_usizeTransactionZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_clone - * Signature: (J)J + * Method: CVec_TxidZ_free + * Signature: ([[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxidZ_1free + (JNIEnv *, jclass, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_NoneChannelMonitorUpdateErrZ_ok + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_err - * Signature: (J)J + * Method: CResult_NoneChannelMonitorUpdateErrZ_err + * Signature: (Lorg/ldk/enums/ChannelMonitorUpdateErr;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_is_ok + * Method: CResult_NoneChannelMonitorUpdateErrZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_free + * Method: CResult_NoneChannelMonitorUpdateErrZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_clone_ptr + * Method: CResult_NoneChannelMonitorUpdateErrZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_EventZDecodeErrorZ_clone + * Method: CResult_NoneChannelMonitorUpdateErrZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_MessageSendEventZ_free + * Method: CVec_MonitorEventZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_FixedPenaltyScorerDecodeErrorZ_ok + * Method: C2Tuple_OutPointCVec_MonitorEventZZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FixedPenaltyScorerDecodeErrorZ_err + * Method: C2Tuple_OutPointCVec_MonitorEventZZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FixedPenaltyScorerDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: C2Tuple_OutPointCVec_MonitorEventZZ_new + * Signature: (J[J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1new + (JNIEnv *, jclass, jlong, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_FixedPenaltyScorerDecodeErrorZ_free + * Method: C2Tuple_OutPointCVec_MonitorEventZZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorEventZZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr - * Signature: (J)J + * Method: CVec_C2Tuple_OutPointCVec_MonitorEventZZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorEventZZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_FixedPenaltyScorerDecodeErrorZ_clone + * Method: COption_C2Tuple_usizeTransactionZZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScoringParametersDecodeErrorZ_ok - * Signature: (J)J + * Method: COption_C2Tuple_usizeTransactionZZ_none + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScoringParametersDecodeErrorZ_err - * Signature: (J)J + * Method: COption_C2Tuple_usizeTransactionZZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScoringParametersDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: COption_C2Tuple_usizeTransactionZZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScoringParametersDecodeErrorZ_free - * Signature: (J)V + * Method: COption_C2Tuple_usizeTransactionZZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScoringParametersDecodeErrorZ_clone_ptr + * Method: CResult_FixedPenaltyScorerDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScoringParametersDecodeErrorZ_clone + * Method: CResult_FixedPenaltyScorerDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScorerDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_FixedPenaltyScorerDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScorerDecodeErrorZ_err - * Signature: (J)J + * Method: CResult_FixedPenaltyScorerDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScorerDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ScorerDecodeErrorZ_free - * Signature: (J)V + * Method: CResult_FixedPenaltyScorerDecodeErrorZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -5879,6 +5951,22 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecod 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 @@ -5913,24 +6001,40 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecode /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_ok + * Method: CResult_ChannelFeaturesDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_err + * Method: CResult_ChannelFeaturesDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeFeaturesDecodeErrorZ_is_ok - * Signature: (J)Z + * 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); @@ -5943,6 +6047,22 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecod 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_InvoiceFeaturesDecodeErrorZ_ok @@ -5975,6 +6095,22 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDe JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_ok @@ -6009,3658 +6145,3698 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDe /* * Class: org_ldk_impl_bindings - * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err + * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok + * Method: CResult_NodeIdDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeIdDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeIdDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free + * Method: CResult_NodeIdDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr + * Method: CResult_NodeIdDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone + * Method: CResult_NodeIdDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone + * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_ok + * Method: COption_AccessZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_err - * Signature: (J)J + * Method: COption_AccessZ_none + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_AccessZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: CResult_boolLightningErrorZ_ok + * Signature: (Z)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok + (JNIEnv *, jclass, jboolean); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_boolLightningErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_free - * Signature: (J)V + * Method: CResult_boolLightningErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr - * Signature: (J)J + * Method: CResult_boolLightningErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_clone + * Method: CResult_boolLightningErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_PaymentPreimageZ_free - * Signature: ([[B)V + * Method: CResult_boolLightningErrorZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureCVec_SignatureZZ_clone_ptr + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureCVec_SignatureZZ_clone + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureCVec_SignatureZZ_new - * Signature: ([B[[B)J + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new - (JNIEnv *, jclass, jbyteArray, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureCVec_SignatureZZ_free + * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok - * Signature: (J)J + * Method: CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err + * Method: CVec_NodeAnnouncementZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneLightningErrorZ_ok * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok + * Method: CResult_NoneLightningErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneLightningErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free + * Method: CResult_NoneLightningErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr + * Method: CResult_NoneLightningErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone + * Method: CResult_NoneLightningErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_ok - * Signature: ([B)J + * Method: CResult_ChannelUpdateInfoDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_err - * Signature: ()J + * Method: CResult_ChannelUpdateInfoDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_is_ok + * Method: CResult_ChannelUpdateInfoDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_free + * Method: CResult_ChannelUpdateInfoDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_clone_ptr + * Method: CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignatureNoneZ_clone + * Method: CResult_ChannelUpdateInfoDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureSignatureZ_clone_ptr + * Method: CResult_ChannelInfoDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureSignatureZ_clone + * Method: CResult_ChannelInfoDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureSignatureZ_new - * Signature: ([B[B)J + * Method: CResult_ChannelInfoDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_SignatureSignatureZ_free + * Method: CResult_ChannelInfoDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_ok + * Method: CResult_ChannelInfoDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_err - * Signature: ()J + * Method: CResult_ChannelInfoDecodeErrorZ_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok + * Method: CResult_RoutingFeesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RoutingFeesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RoutingFeesDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_free + * Method: CResult_RoutingFeesDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr + * Method: CResult_RoutingFeesDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_clone + * Method: CResult_RoutingFeesDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyNoneZ_ok - * Signature: ([B)J + * Method: CVec_NetAddressZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyNoneZ_err - * Signature: ()J + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyNoneZ_is_ok + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyNoneZ_free + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyNoneZ_clone_ptr + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyNoneZ_clone + * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignDecodeErrorZ_ok + * Method: CVec_u64Z_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NodeInfoDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignDecodeErrorZ_err + * Method: CResult_NodeInfoDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignDecodeErrorZ_is_ok + * Method: CResult_NodeInfoDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignDecodeErrorZ_free + * Method: CResult_NodeInfoDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignDecodeErrorZ_clone_ptr + * Method: CResult_NodeInfoDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignDecodeErrorZ_clone + * Method: CResult_NodeInfoDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_u5Z_free - * Signature: ([B)V + * Method: CResult_NetworkGraphDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u5Z_1free - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RecoverableSignatureNoneZ_ok - * Signature: ([B)J + * Method: CResult_NetworkGraphDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RecoverableSignatureNoneZ_err - * Signature: ()J + * Method: CResult_NetworkGraphDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RecoverableSignatureNoneZ_is_ok - * Signature: (J)Z + * Method: CResult_NetworkGraphDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RecoverableSignatureNoneZ_free - * Signature: (J)V + * Method: COption_CVec_NetAddressZZ_some + * Signature: ([J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_RecoverableSignatureNoneZ_clone_ptr - * Signature: (J)J + * Method: COption_CVec_NetAddressZZ_none + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_RecoverableSignatureNoneZ_clone - * Signature: (J)J + * Method: COption_CVec_NetAddressZZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_u8Z_free - * Signature: ([B)V + * Method: COption_CVec_NetAddressZZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_CVec_u8ZZ_free - * Signature: ([[B)V + * Method: COption_CVec_NetAddressZZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_CVec_u8ZZNoneZ_ok - * Signature: ([[B)J + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_CVec_u8ZZNoneZ_err - * Signature: ()J + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_CVec_u8ZZNoneZ_is_ok + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_CVec_u8ZZNoneZ_free + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_CVec_u8ZZNoneZ_clone_ptr + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_CVec_u8ZZNoneZ_clone + * Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InMemorySignerDecodeErrorZ_ok + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InMemorySignerDecodeErrorZ_err + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InMemorySignerDecodeErrorZ_is_ok + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InMemorySignerDecodeErrorZ_free + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InMemorySignerDecodeErrorZ_clone_ptr + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InMemorySignerDecodeErrorZ_clone + * Method: CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_TxOutZ_free - * Signature: ([J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TransactionNoneZ_ok - * Signature: ([B)J + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TransactionNoneZ_err - * Signature: ()J + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TransactionNoneZ_is_ok + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TransactionNoneZ_free + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TransactionNoneZ_clone_ptr + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TransactionNoneZ_clone + * Method: CResult_SpendableOutputDescriptorDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlockHashChannelMonitorZ_clone_ptr - * Signature: (J)J + * Method: CVec_PaymentPreimageZ_free + * Signature: ([[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free + (JNIEnv *, jclass, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlockHashChannelMonitorZ_clone + * Method: C2Tuple_SignatureCVec_SignatureZZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlockHashChannelMonitorZ_new - * Signature: ([BJ)J + * Method: C2Tuple_SignatureCVec_SignatureZZ_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlockHashChannelMonitorZ_free - * Signature: (J)V + * Method: C2Tuple_SignatureCVec_SignatureZZ_new + * Signature: ([B[[B)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new + (JNIEnv *, jclass, jbyteArray, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_BlockHashChannelMonitorZZ_free - * Signature: ([J)V + * Method: C2Tuple_SignatureCVec_SignatureZZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok - * Signature: ([J)J + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err - * Signature: (Lorg/ldk/enums/IOError;)J + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone + * Method: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_u16Z_some - * Signature: (S)J + * Method: CResult_SignatureNoneZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some - (JNIEnv *, jclass, jshort); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: COption_u16Z_none + * Method: CResult_SignatureNoneZ_err * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: COption_u16Z_free + * Method: CResult_SignatureNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SignatureNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_u16Z_clone_ptr + * Method: CResult_SignatureNoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_u16Z_clone + * Method: CResult_SignatureNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_ok - * Signature: ()J + * Method: C2Tuple_SignatureSignatureZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_err + * Method: C2Tuple_SignatureSignatureZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_is_ok - * Signature: (J)Z + * Method: C2Tuple_SignatureSignatureZ_new + * Signature: ([B[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_free + * Method: C2Tuple_SignatureSignatureZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureSignatureZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_clone_ptr + * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneAPIErrorZ_clone - * Signature: (J)J + * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_err + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_CResult_NoneAPIErrorZZ_free - * Signature: ([J)V + * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_APIErrorZ_free - * Signature: ([J)V + * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult__u832APIErrorZ_ok + * Method: CResult_C2Tuple_SignatureSignatureZNoneZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureSignatureZNoneZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SecretKeyNoneZ_ok * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1ok (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult__u832APIErrorZ_err - * Signature: (J)J + * Method: CResult_SecretKeyNoneZ_err + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1err + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult__u832APIErrorZ_is_ok + * Method: CResult_SecretKeyNoneZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult__u832APIErrorZ_free + * Method: CResult_SecretKeyNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult__u832APIErrorZ_clone_ptr + * Method: CResult_SecretKeyNoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult__u832APIErrorZ_clone + * Method: CResult_SecretKeyNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_ok - * Signature: ([B)J + * Method: CResult_SignDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_err + * Method: CResult_SignDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_is_ok + * Method: CResult_SignDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_free + * Method: CResult_SignDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_clone_ptr + * Method: CResult_SignDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_clone + * Method: CResult_SignDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_ok - * Signature: ()J + * Method: CVec_u5Z_free + * Signature: ([B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u5Z_1free + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_err - * Signature: (J)J + * Method: CResult_RecoverableSignatureNoneZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_is_ok + * Method: CResult_RecoverableSignatureNoneZ_err + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RecoverableSignatureNoneZ_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_1RecoverableSignatureNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_free + * Method: CResult_RecoverableSignatureNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_clone_ptr + * Method: CResult_RecoverableSignatureNoneZ_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_1RecoverableSignatureNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_clone + * Method: CResult_RecoverableSignatureNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PaymentHashPaymentIdZ_clone_ptr - * Signature: (J)J + * Method: CVec_u8Z_free + * Signature: ([B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PaymentHashPaymentIdZ_clone - * Signature: (J)J + * Method: CVec_CVec_u8ZZ_free + * Signature: ([[B)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free + (JNIEnv *, jclass, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PaymentHashPaymentIdZ_new - * Signature: ([B[B)J + * Method: CResult_CVec_CVec_u8ZZNoneZ_ok + * Signature: ([[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok + (JNIEnv *, jclass, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PaymentHashPaymentIdZ_free - * Signature: (J)V + * Method: CResult_CVec_CVec_u8ZZNoneZ_err + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok - * Signature: (J)J + * Method: CResult_CVec_CVec_u8ZZNoneZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err - * Signature: (J)J + * Method: CResult_CVec_CVec_u8ZZNoneZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok - * Signature: (J)Z + * Method: CResult_CVec_CVec_u8ZZNoneZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free - * Signature: (J)V + * Method: CResult_CVec_CVec_u8ZZNoneZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr + * Method: CResult_InMemorySignerDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone + * Method: CResult_InMemorySignerDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_NetAddressZ_free - * Signature: ([J)V + * Method: CResult_InMemorySignerDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PaymentHashPaymentSecretZ_clone_ptr - * Signature: (J)J + * Method: CResult_InMemorySignerDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PaymentHashPaymentSecretZ_clone + * Method: CResult_InMemorySignerDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PaymentHashPaymentSecretZ_new - * Signature: ([B[B)J + * Method: CResult_InMemorySignerDecodeErrorZ_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PaymentHashPaymentSecretZ_free - * Signature: (J)V + * Method: CVec_TxOutZ_free + * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok - * Signature: (J)J + * Method: CResult_TransactionNoneZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err + * Method: CResult_TransactionNoneZ_err * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok + * Method: CResult_TransactionNoneZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free + * Method: CResult_TransactionNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr + * Method: CResult_TransactionNoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone + * Method: CResult_TransactionNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok + * Method: C2Tuple_BlockHashChannelMonitorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err + * Method: C2Tuple_BlockHashChannelMonitorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok - * Signature: (J)Z + * Method: C2Tuple_BlockHashChannelMonitorZ_new + * Signature: ([BJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free + * Method: C2Tuple_BlockHashChannelMonitorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone - * Signature: (J)J + * Method: CVec_C2Tuple_BlockHashChannelMonitorZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretNoneZ_ok - * Signature: ([B)J + * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok + * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretNoneZ_err - * Signature: ()J + * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err + * Signature: (Lorg/ldk/enums/IOError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretNoneZ_is_ok + * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretNoneZ_free + * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretNoneZ_clone_ptr + * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretNoneZ_clone + * Method: CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretAPIErrorZ_ok - * Signature: ([B)J + * Method: COption_u16Z_some + * Signature: (S)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some + (JNIEnv *, jclass, jshort); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretAPIErrorZ_err - * Signature: (J)J + * Method: COption_u16Z_none + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretAPIErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretAPIErrorZ_free + * Method: COption_u16Z_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretAPIErrorZ_clone_ptr + * Method: COption_u16Z_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentSecretAPIErrorZ_clone + * Method: COption_u16Z_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentPreimageAPIErrorZ_ok - * Signature: ([B)J + * Method: CResult_NoneAPIErrorZ_ok + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentPreimageAPIErrorZ_err + * Method: CResult_NoneAPIErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentPreimageAPIErrorZ_is_ok + * Method: CResult_NoneAPIErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentPreimageAPIErrorZ_free + * Method: CResult_NoneAPIErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentPreimageAPIErrorZ_clone_ptr + * Method: CResult_NoneAPIErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentPreimageAPIErrorZ_clone + * Method: CResult_NoneAPIErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_ok - * Signature: (J)J + * Method: CVec_CResult_NoneAPIErrorZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_err + * 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: CResult__u832APIErrorZ_ok + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1ok + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult__u832APIErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok + * Method: CResult__u832APIErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_free + * Method: CResult__u832APIErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr + * Method: CResult__u832APIErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_clone + * Method: CResult__u832APIErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelCounterpartyDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_PaymentIdPaymentSendFailureZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelCounterpartyDecodeErrorZ_err + * Method: CResult_PaymentIdPaymentSendFailureZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelCounterpartyDecodeErrorZ_is_ok + * Method: CResult_PaymentIdPaymentSendFailureZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelCounterpartyDecodeErrorZ_free + * Method: CResult_PaymentIdPaymentSendFailureZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr + * Method: CResult_PaymentIdPaymentSendFailureZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelCounterpartyDecodeErrorZ_clone + * Method: CResult_PaymentIdPaymentSendFailureZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelDetailsDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_NonePaymentSendFailureZ_ok + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelDetailsDecodeErrorZ_err + * Method: CResult_NonePaymentSendFailureZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelDetailsDecodeErrorZ_is_ok + * Method: CResult_NonePaymentSendFailureZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelDetailsDecodeErrorZ_free + * Method: CResult_NonePaymentSendFailureZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelDetailsDecodeErrorZ_clone_ptr + * Method: CResult_NonePaymentSendFailureZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelDetailsDecodeErrorZ_clone + * Method: CResult_NonePaymentSendFailureZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PhantomRouteHintsDecodeErrorZ_ok + * Method: C2Tuple_PaymentHashPaymentIdZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PhantomRouteHintsDecodeErrorZ_err + * Method: C2Tuple_PaymentHashPaymentIdZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PhantomRouteHintsDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: C2Tuple_PaymentHashPaymentIdZ_new + * Signature: ([B[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_PhantomRouteHintsDecodeErrorZ_free + * Method: C2Tuple_PaymentHashPaymentIdZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr + * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PhantomRouteHintsDecodeErrorZ_clone + * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_ChannelMonitorZ_free - * Signature: ([J)V + * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlockHashChannelManagerZ_new - * Signature: ([BJ)J + * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_BlockHashChannelManagerZ_free - * Signature: (J)V + * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok + * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err + * Method: C2Tuple_PaymentHashPaymentSecretZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: C2Tuple_PaymentHashPaymentSecretZ_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free + * Method: C2Tuple_PaymentHashPaymentSecretZ_new + * Signature: ([B[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PaymentHashPaymentSecretZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelConfigDecodeErrorZ_ok + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelConfigDecodeErrorZ_err - * Signature: (J)J + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelConfigDecodeErrorZ_is_ok + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelConfigDecodeErrorZ_free + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelConfigDecodeErrorZ_clone_ptr + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelConfigDecodeErrorZ_clone + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_OutPointDecodeErrorZ_ok + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_OutPointDecodeErrorZ_err + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_OutPointDecodeErrorZ_is_ok + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_OutPointDecodeErrorZ_free + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_OutPointDecodeErrorZ_clone_ptr + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_OutPointDecodeErrorZ_clone + * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_TypeZ_some - * Signature: (J)J + * Method: CResult_PaymentSecretNoneZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: COption_TypeZ_none + * Method: CResult_PaymentSecretNoneZ_err * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: COption_TypeZ_free - * Signature: (J)V + * Method: CResult_PaymentSecretNoneZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_TypeZ_clone_ptr - * Signature: (J)J + * Method: CResult_PaymentSecretNoneZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_TypeZ_clone + * Method: CResult_PaymentSecretNoneZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_TypeZDecodeErrorZ_ok + * Method: CResult_PaymentSecretNoneZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_TypeZDecodeErrorZ_err + * Method: CResult_PaymentSecretAPIErrorZ_ok + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PaymentSecretAPIErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_TypeZDecodeErrorZ_is_ok + * Method: CResult_PaymentSecretAPIErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_TypeZDecodeErrorZ_free + * Method: CResult_PaymentSecretAPIErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_TypeZDecodeErrorZ_clone_ptr + * Method: CResult_PaymentSecretAPIErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_TypeZDecodeErrorZ_clone + * Method: CResult_PaymentSecretAPIErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentErrorZ_ok + * Method: CResult_PaymentPreimageAPIErrorZ_ok * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1ok (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentErrorZ_err + * Method: CResult_PaymentPreimageAPIErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentErrorZ_is_ok + * Method: CResult_PaymentPreimageAPIErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentErrorZ_free + * Method: CResult_PaymentPreimageAPIErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentErrorZ_clone_ptr + * Method: CResult_PaymentPreimageAPIErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentErrorZ_clone + * Method: CResult_PaymentPreimageAPIErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_ok - * Signature: (Lorg/ldk/enums/SiPrefix;)J + * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_err + * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_is_ok + * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_free + * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_clone_ptr + * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_clone + * Method: CResult_CounterpartyForwardingInfoDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_ok + * Method: CResult_ChannelCounterpartyDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_err + * Method: CResult_ChannelCounterpartyDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_is_ok + * Method: CResult_ChannelCounterpartyDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_free + * Method: CResult_ChannelCounterpartyDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_clone_ptr + * Method: CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_clone + * Method: CResult_ChannelCounterpartyDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_ok + * Method: CResult_ChannelDetailsDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_err + * Method: CResult_ChannelDetailsDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_is_ok + * Method: CResult_ChannelDetailsDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_free + * Method: CResult_ChannelDetailsDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_clone_ptr + * Method: CResult_ChannelDetailsDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_clone + * Method: CResult_ChannelDetailsDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr + * Method: CResult_PhantomRouteHintsDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone + * Method: CResult_PhantomRouteHintsDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_new - * Signature: (J[BJ)J + * Method: CResult_PhantomRouteHintsDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_free + * Method: CResult_PhantomRouteHintsDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_ok + * Method: CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_err - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + * Method: CResult_PhantomRouteHintsDecodeErrorZ_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_is_ok - * Signature: (J)Z + * Method: CVec_ChannelMonitorZ_free + * Signature: ([J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_free + * Method: C2Tuple_BlockHashChannelManagerZ_new + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new + (JNIEnv *, jclass, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_BlockHashChannelManagerZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_clone_ptr + * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_clone + * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_PrivateRouteZ_free - * Signature: ([J)V + * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_ok - * Signature: (J)J + * Method: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_err - * Signature: (Lorg/ldk/enums/CreationError;)J + * Method: CResult_ChannelConfigDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_is_ok + * Method: CResult_ChannelConfigDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_ChannelConfigDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_free + * Method: CResult_ChannelConfigDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_clone_ptr + * Method: CResult_ChannelConfigDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_clone + * Method: CResult_ChannelConfigDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_ok - * Signature: ()J + * Method: CResult_OutPointDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_err - * Signature: (Lorg/ldk/enums/SemanticError;)J + * Method: CResult_OutPointDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_is_ok + * Method: CResult_OutPointDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_free + * Method: CResult_OutPointDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_clone_ptr + * Method: CResult_OutPointDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_clone + * Method: CResult_OutPointDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_ok + * Method: COption_TypeZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_err - * Signature: (Lorg/ldk/enums/SemanticError;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_is_ok - * Signature: (J)Z + * Method: COption_TypeZ_none + * Signature: ()J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_free + * Method: COption_TypeZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_clone_ptr + * Method: COption_TypeZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_clone + * Method: COption_TypeZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_ok + * Method: CResult_COption_TypeZDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_err - * Signature: (Lorg/ldk/enums/CreationError;)J + * Method: CResult_COption_TypeZDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_is_ok + * Method: CResult_COption_TypeZDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_free + * Method: CResult_COption_TypeZDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_clone_ptr + * Method: CResult_COption_TypeZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_clone + * Method: CResult_COption_TypeZDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_ok - * Signature: (J)J + * Method: CResult_PaymentIdPaymentErrorZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_err - * Signature: (Lorg/ldk/enums/CreationError;)J + * Method: CResult_PaymentIdPaymentErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_is_ok + * Method: CResult_PaymentIdPaymentErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_free + * Method: CResult_PaymentIdPaymentErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_clone_ptr + * Method: CResult_PaymentIdPaymentErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_clone + * Method: CResult_PaymentIdPaymentErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_ok - * Signature: (Ljava/lang/String;)J + * Method: CResult_SiPrefixParseErrorZ_ok + * Signature: (Lorg/ldk/enums/SiPrefix;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok - (JNIEnv *, jclass, jstring); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_err - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + * Method: CResult_SiPrefixParseErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_is_ok + * Method: CResult_SiPrefixParseErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_free + * Method: CResult_SiPrefixParseErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_ok + * Method: CResult_SiPrefixParseErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_err + * Method: CResult_SiPrefixParseErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr + * Method: CResult_InvoiceParseOrSemanticErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone + * Method: CResult_InvoiceParseOrSemanticErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_some - * Signature: (J)J + * Method: CResult_InvoiceParseOrSemanticErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_none - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_free + * Method: CResult_InvoiceParseOrSemanticErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_clone_ptr + * Method: CResult_InvoiceParseOrSemanticErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_clone + * Method: CResult_InvoiceParseOrSemanticErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_ok + * Method: CResult_SignedRawInvoiceParseErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_err + * Method: CResult_SignedRawInvoiceParseErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_is_ok + * Method: CResult_SignedRawInvoiceParseErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_free + * Method: CResult_SignedRawInvoiceParseErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr + * Method: CResult_SignedRawInvoiceParseErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone + * Method: CResult_SignedRawInvoiceParseErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_ok + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_err + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_new + * Signature: (J[BJ)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new + (JNIEnv *, jclass, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_free + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_clone_ptr + * Method: CResult_PayeePubKeyErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_clone - * Signature: (J)J + * Method: CResult_PayeePubKeyErrorZ_err + * Signature: (Lorg/ldk/enums/Secp256k1Error;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_clone_ptr - * Signature: (J)J + * Method: CResult_PayeePubKeyErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_clone - * Signature: (J)J + * Method: CResult_PayeePubKeyErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_new - * Signature: (J[B)J + * Method: CResult_PayeePubKeyErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_free - * Signature: (J)V + * Method: CResult_PayeePubKeyErrorZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_clone_ptr - * Signature: (J)J + * Method: CVec_PrivateRouteZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_clone + * Method: CResult_PositiveTimestampCreationErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_new - * Signature: (I[B)J + * Method: CResult_PositiveTimestampCreationErrorZ_err + * Signature: (Lorg/ldk/enums/CreationError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new - (JNIEnv *, jclass, jint, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_free - * Signature: (J)V + * Method: CResult_PositiveTimestampCreationErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_u32ScriptZZ_free - * Signature: ([J)V + * Method: CResult_PositiveTimestampCreationErrorZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr + * Method: CResult_PositiveTimestampCreationErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone + * Method: CResult_PositiveTimestampCreationErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new - * Signature: ([B[J)J + * Method: CResult_NoneSemanticErrorZ_ok + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new - (JNIEnv *, jclass, jbyteArray, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free - * Signature: (J)V + * Method: CResult_NoneSemanticErrorZ_err + * Signature: (Lorg/ldk/enums/SemanticError;)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free - * Signature: ([J)V + * Method: CResult_NoneSemanticErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_EventZ_free - * Signature: ([J)V + * Method: CResult_NoneSemanticErrorZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_TransactionZ_free - * Signature: ([[B)V + * Method: CResult_NoneSemanticErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_clone_ptr + * Method: CResult_NoneSemanticErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_clone + * Method: CResult_InvoiceSemanticErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_new - * Signature: (IJ)J + * Method: CResult_InvoiceSemanticErrorZ_err + * Signature: (Lorg/ldk/enums/SemanticError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new - (JNIEnv *, jclass, jint, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_free + * Method: CResult_InvoiceSemanticErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceSemanticErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_u32TxOutZZ_free - * Signature: ([J)V + * Method: CResult_InvoiceSemanticErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr + * Method: CResult_InvoiceSemanticErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone + * Method: CResult_DescriptionCreationErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new - * Signature: ([B[J)J + * Method: CResult_DescriptionCreationErrorZ_err + * Signature: (Lorg/ldk/enums/CreationError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new - (JNIEnv *, jclass, jbyteArray, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free - * Signature: (J)V + * Method: CResult_DescriptionCreationErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free - * Signature: ([J)V + * Method: CResult_DescriptionCreationErrorZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_BalanceZ_free - * Signature: ([J)V + * Method: CResult_DescriptionCreationErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BalanceZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok + * Method: CResult_DescriptionCreationErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err + * Method: CResult_PrivateRouteCreationErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok + * Method: CResult_PrivateRouteCreationErrorZ_err + * Signature: (Lorg/ldk/enums/CreationError;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PrivateRouteCreationErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free + * Method: CResult_PrivateRouteCreationErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr + * Method: CResult_PrivateRouteCreationErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone + * Method: CResult_PrivateRouteCreationErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneLightningErrorZ_ok - * Signature: ()J + * Method: CResult_StringErrorZ_ok + * Signature: (Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok + (JNIEnv *, jclass, jstring); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneLightningErrorZ_err - * Signature: (J)J + * Method: CResult_StringErrorZ_err + * Signature: (Lorg/ldk/enums/Secp256k1Error;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneLightningErrorZ_is_ok + * Method: CResult_StringErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneLightningErrorZ_free + * Method: CResult_StringErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneLightningErrorZ_clone_ptr + * Method: CResult_StringErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneLightningErrorZ_clone + * Method: CResult_StringErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_clone_ptr + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_clone + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_new - * Signature: ([BJ)J + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1new - (JNIEnv *, jclass, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_free + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_PublicKeyTypeZZ_free - * Signature: ([J)V + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_ok - * Signature: (Z)J + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok - (JNIEnv *, jclass, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_err + * Method: COption_MonitorEventZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_is_ok - * Signature: (J)Z + * Method: COption_MonitorEventZ_none + * Signature: ()J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_free + * Method: COption_MonitorEventZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_clone_ptr + * Method: COption_MonitorEventZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolLightningErrorZ_clone + * Method: COption_MonitorEventZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr + * Method: CResult_COption_MonitorEventZDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone + * Method: CResult_COption_MonitorEventZDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new - * Signature: (JJJ)J + * Method: CResult_COption_MonitorEventZDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new - (JNIEnv *, jclass, jlong, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free + * Method: CResult_COption_MonitorEventZDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free - * Signature: ([J)V + * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_NodeAnnouncementZ_free - * Signature: ([J)V + * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_PublicKeyZ_free - * Signature: ([[B)V + * Method: CResult_HTLCUpdateDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_some + * Method: CResult_HTLCUpdateDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_none - * Signature: ()J + * Method: CResult_HTLCUpdateDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none - (JNIEnv *, jclass); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_free + * Method: CResult_HTLCUpdateDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_clone_ptr + * Method: CResult_HTLCUpdateDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_clone + * Method: CResult_HTLCUpdateDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_ok - * Signature: ([B)J + * Method: C2Tuple_OutPointScriptZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_err + * Method: C2Tuple_OutPointScriptZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_is_ok - * Signature: (J)Z + * Method: C2Tuple_OutPointScriptZ_new + * Signature: (J[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_free + * Method: C2Tuple_OutPointScriptZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr + * Method: C2Tuple_u32ScriptZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone + * Method: C2Tuple_u32ScriptZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_ok - * Signature: ()J + * Method: C2Tuple_u32ScriptZ_new + * Signature: (I[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new + (JNIEnv *, jclass, jint, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_err - * Signature: (J)J + * Method: C2Tuple_u32ScriptZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_is_ok - * Signature: (J)Z + * Method: CVec_C2Tuple_u32ScriptZZ_free + * Signature: ([J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_free - * Signature: (J)V + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_clone_ptr + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_clone - * Signature: (J)J + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new + * Signature: ([B[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new + (JNIEnv *, jclass, jbyteArray, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_ok - * Signature: (Z)J + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok - (JNIEnv *, jclass, jboolean); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_err - * Signature: (J)J + * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_is_ok - * Signature: (J)Z + * Method: CVec_EventZ_free + * Signature: ([J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_free - * Signature: (J)V + * Method: CVec_TransactionZ_free + * Signature: ([[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free + (JNIEnv *, jclass, jobjectArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_clone_ptr + * Method: C2Tuple_u32TxOutZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_clone + * Method: C2Tuple_u32TxOutZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeIdDecodeErrorZ_ok - * Signature: (J)J + * Method: C2Tuple_u32TxOutZ_new + * Signature: (IJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new + (JNIEnv *, jclass, jint, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_u32TxOutZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeIdDecodeErrorZ_err + * Method: CVec_C2Tuple_u32TxOutZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeIdDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeIdDecodeErrorZ_free + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new + * Signature: ([B[J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new + (JNIEnv *, jclass, jbyteArray, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeIdDecodeErrorZ_clone_ptr - * Signature: (J)J + * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeIdDecodeErrorZ_clone - * Signature: (J)J + * Method: CVec_BalanceZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BalanceZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_ok + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_err + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_free + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_NetworkUpdateZDecodeErrorZ_clone + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_AccessZ_some + * Method: C2Tuple_PublicKeyTypeZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_AccessZ_none - * Signature: ()J + * Method: C2Tuple_PublicKeyTypeZ_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1none - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_AccessZ_free + * Method: C2Tuple_PublicKeyTypeZ_new + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1new + (JNIEnv *, jclass, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_PublicKeyTypeZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelUpdateInfoDecodeErrorZ_ok - * Signature: (J)J + * Method: CVec_C2Tuple_PublicKeyTypeZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelUpdateInfoDecodeErrorZ_err + * Method: COption_NetAddressZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelUpdateInfoDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: COption_NetAddressZ_none + * Signature: ()J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelUpdateInfoDecodeErrorZ_free + * Method: COption_NetAddressZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr + * Method: COption_NetAddressZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelUpdateInfoDecodeErrorZ_clone + * Method: COption_NetAddressZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelInfoDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_CVec_u8ZPeerHandleErrorZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelInfoDecodeErrorZ_err + * Method: CResult_CVec_u8ZPeerHandleErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelInfoDecodeErrorZ_is_ok + * Method: CResult_CVec_u8ZPeerHandleErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelInfoDecodeErrorZ_free + * Method: CResult_CVec_u8ZPeerHandleErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelInfoDecodeErrorZ_clone_ptr + * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelInfoDecodeErrorZ_clone + * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RoutingFeesDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_NonePeerHandleErrorZ_ok + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_RoutingFeesDecodeErrorZ_err + * Method: CResult_NonePeerHandleErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RoutingFeesDecodeErrorZ_is_ok + * Method: CResult_NonePeerHandleErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RoutingFeesDecodeErrorZ_free + * Method: CResult_NonePeerHandleErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RoutingFeesDecodeErrorZ_clone_ptr + * Method: CResult_NonePeerHandleErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RoutingFeesDecodeErrorZ_clone + * Method: CResult_NonePeerHandleErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_boolPeerHandleErrorZ_ok + * Signature: (Z)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok + (JNIEnv *, jclass, jboolean); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_err + * Method: CResult_boolPeerHandleErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok + * Method: CResult_boolPeerHandleErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_free + * Method: CResult_boolPeerHandleErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr + * Method: CResult_boolPeerHandleErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeAnnouncementInfoDecodeErrorZ_clone + * Method: CResult_boolPeerHandleErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_u64Z_free - * Signature: ([J)V + * Method: CResult_u32GraphSyncErrorZ_ok + * Signature: (I)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1ok + (JNIEnv *, jclass, jint); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeInfoDecodeErrorZ_ok + * Method: CResult_u32GraphSyncErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeInfoDecodeErrorZ_err - * Signature: (J)J + * Method: CResult_u32GraphSyncErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeInfoDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: CResult_u32GraphSyncErrorZ_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeInfoDecodeErrorZ_free - * Signature: (J)V + * Method: CResult_NetAddressDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NodeInfoDecodeErrorZ_clone_ptr + * Method: CResult_NetAddressDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NodeInfoDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NetworkGraphDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NetworkGraphDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NetworkGraphDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NetworkGraphDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NetworkGraphDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NetworkGraphDecodeErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_CVec_NetAddressZZ_some - * Signature: ([J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some - (JNIEnv *, jclass, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_CVec_NetAddressZZ_none - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_CVec_NetAddressZZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_CVec_NetAddressZZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_CVec_NetAddressZZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NetAddressDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_NetAddressDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* @@ -10113,50 +10289,50 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeE /* * Class: org_ldk_impl_bindings - * Method: CResult_FundingLockedDecodeErrorZ_ok + * Method: CResult_ChannelReadyDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FundingLockedDecodeErrorZ_err + * Method: CResult_ChannelReadyDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FundingLockedDecodeErrorZ_is_ok + * Method: CResult_ChannelReadyDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FundingLockedDecodeErrorZ_free + * Method: CResult_ChannelReadyDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FundingLockedDecodeErrorZ_clone_ptr + * Method: CResult_ChannelReadyDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_FundingLockedDecodeErrorZ_clone + * Method: CResult_ChannelReadyDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -11471,6 +11647,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1paym JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: PaymentPurpose_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: PaymentPurpose_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: ClosureReason_free @@ -11602,10 +11794,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone /* * Class: org_ldk_impl_bindings * Method: Event_funding_generation_ready - * Signature: ([BJ[BJ)J + * Signature: ([B[BJ[BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready - (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlong); + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings @@ -11617,19 +11809,19 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received /* * Class: org_ldk_impl_bindings - * Method: Event_payment_sent - * Signature: ([B[B[BJ)J + * Method: Event_payment_claimed + * Signature: ([BJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent - (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed + (JNIEnv *, jclass, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: Event_payment_path_failed - * Signature: ([B[BZJZ[JJJ)J + * Method: Event_payment_sent + * Signature: ([B[B[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed - (JNIEnv *, jclass, jbyteArray, jbyteArray, jboolean, jlong, jboolean, jlongArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent + (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings @@ -11639,6 +11831,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed (JNIEnv *, jclass, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: Event_payment_path_successful + * Signature: ([B[B[J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Event_payment_path_failed + * Signature: ([B[BZJZ[JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed + (JNIEnv *, jclass, jbyteArray, jbyteArray, jboolean, jlong, jboolean, jlongArray, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: Event_pending_htlcs_forwardable @@ -11658,10 +11866,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs /* * Class: org_ldk_impl_bindings * Method: Event_payment_forwarded - * Signature: (JZ)J + * Signature: ([B[BJZ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded - (JNIEnv *, jclass, jlong, jboolean); + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jboolean); /* * Class: org_ldk_impl_bindings @@ -11679,14 +11887,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding (JNIEnv *, jclass, jbyteArray, jbyteArray); -/* - * Class: org_ldk_impl_bindings - * Method: Event_payment_path_successful - * Signature: ([B[B[J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlongArray); - /* * Class: org_ldk_impl_bindings * Method: Event_open_channel_request @@ -11769,10 +11969,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fundi /* * Class: org_ldk_impl_bindings - * Method: MessageSendEvent_send_funding_locked + * Method: MessageSendEvent_send_channel_ready * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1locked +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready (JNIEnv *, jclass, jbyteArray, jlong); /* @@ -11991,6 +12191,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1fa JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: BigSize_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BigSize_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BigSize_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BigSize_set_a + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1set_1a + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BigSize_new + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BigSize_1new + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: sign @@ -12023,6 +12255,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage (JNIEnv *, jclass, jbyteArray, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: Persister_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Level_clone @@ -12271,6 +12511,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel + * Signature: (J)B + */ +JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1max_1inbound_1htlc_1value_1in_1flight_1percent_1of_1channel + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel + * Signature: (JB)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1max_1inbound_1htlc_1value_1in_1flight_1percent_1of_1channel + (JNIEnv *, jclass, jlong, jbyte); + /* * Class: org_ldk_impl_bindings * Method: ChannelHandshakeConfig_get_negotiate_scid_privacy @@ -12290,10 +12546,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1n /* * Class: org_ldk_impl_bindings * Method: ChannelHandshakeConfig_new - * Signature: (ISJZ)J + * Signature: (ISJBZ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new - (JNIEnv *, jclass, jint, jshort, jlong, jboolean); + (JNIEnv *, jclass, jint, jshort, jlong, jbyte, jboolean); /* * Class: org_ldk_impl_bindings @@ -12343,6 +12599,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelHandshakeLimits_get_max_funding_satoshis + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1funding_1satoshis + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelHandshakeLimits_set_max_funding_satoshis + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1funding_1satoshis + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelHandshakeLimits_get_max_htlc_minimum_msat @@ -12423,6 +12695,22 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1m JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth (JNIEnv *, jclass, jlong, jint); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelHandshakeLimits_get_trust_own_funding_0conf + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1trust_1own_1funding_10conf + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelHandshakeLimits_set_trust_own_funding_0conf + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1trust_1own_1funding_10conf + (JNIEnv *, jclass, jlong, jboolean); + /* * Class: org_ldk_impl_bindings * Method: ChannelHandshakeLimits_get_force_announced_channel_preference @@ -12458,10 +12746,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1t /* * Class: org_ldk_impl_bindings * Method: ChannelHandshakeLimits_new - * Signature: (JJJJSIZS)J + * Signature: (JJJJJSIZZS)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jshort, jint, jboolean, jshort); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jshort, jint, jboolean, jboolean, jshort); /* * Class: org_ldk_impl_bindings @@ -14639,13 +14927,45 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1for JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forwarding_1info (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelCounterparty_get_outbound_htlc_minimum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelCounterparty_set_outbound_htlc_minimum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1outbound_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelCounterparty_get_outbound_htlc_maximum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelCounterparty_set_outbound_htlc_maximum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1outbound_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelCounterparty_new - * Signature: ([BJJJ)J + * Signature: ([BJJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new - (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong); + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -14751,6 +15071,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1c JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_get_outbound_scid_alias + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1scid_1alias + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_set_outbound_scid_alias + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1scid_1alias + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_get_inbound_scid_alias @@ -14847,6 +15183,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_get_next_outbound_htlc_limit_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1next_1outbound_1htlc_1limit_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_set_next_outbound_htlc_limit_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1next_1outbound_1htlc_1limit_1msat + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_get_inbound_capacity_msat @@ -14913,18 +15265,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbo /* * Class: org_ldk_impl_bindings - * Method: ChannelDetails_get_is_funding_locked + * Method: ChannelDetails_get_is_channel_ready * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1funding_1locked +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1channel_1ready (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelDetails_set_is_funding_locked + * Method: ChannelDetails_set_is_channel_ready * Signature: (JZ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1funding_1locked +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1channel_1ready (JNIEnv *, jclass, jlong, jboolean); /* @@ -14959,13 +15311,45 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1p JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public (JNIEnv *, jclass, jlong, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_get_inbound_htlc_minimum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_set_inbound_htlc_minimum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1htlc_1minimum_1msat + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_get_inbound_htlc_maximum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_set_inbound_htlc_maximum_msat + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_new - * Signature: ([BJJJJJJJJJJJJJZZZZ)J + * Signature: ([BJJJJJJJJJJJJJJJZZZZJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new - (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean); + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -14991,6 +15375,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1payment_1scid (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_get_outbound_payment_scid + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1payment_1scid + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: PaymentSendFailure_free @@ -15170,26 +15562,26 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1us /* * Class: org_ldk_impl_bindings * Method: ChannelManager_close_channel - * Signature: (J[B)J + * Signature: (J[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel - (JNIEnv *, jclass, jlong, jbyteArray); + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings * Method: ChannelManager_close_channel_with_target_feerate - * Signature: (J[BI)J + * Signature: (J[B[BI)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel_1with_1target_1feerate - (JNIEnv *, jclass, jlong, jbyteArray, jint); + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jint); /* * Class: org_ldk_impl_bindings * Method: ChannelManager_force_close_channel - * Signature: (J[B)J + * Signature: (J[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel - (JNIEnv *, jclass, jlong, jbyteArray); + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -15234,10 +15626,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontan /* * Class: org_ldk_impl_bindings * Method: ChannelManager_funding_transaction_generated - * Signature: (J[B[B)J + * Signature: (J[B[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray); + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -15266,17 +15658,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1o /* * Class: org_ldk_impl_bindings * Method: ChannelManager_fail_htlc_backwards - * Signature: (J[B)Z + * Signature: (J[B)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings * Method: ChannelManager_claim_funds - * Signature: (J[B)Z + * Signature: (J[B)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds (JNIEnv *, jclass, jlong, jbyteArray); /* @@ -15290,10 +15682,18 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our /* * Class: org_ldk_impl_bindings * Method: ChannelManager_accept_inbound_channel - * Signature: (J[BJ)J + * Signature: (J[B[BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel - (JNIEnv *, jclass, jlong, jbyteArray, jlong); + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_accept_inbound_channel_from_trusted_peer_0conf + * Signature: (J[B[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel_1from_1trusted_1peer_10conf + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings @@ -15607,6 +16007,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1read (JNIEnv *, jclass, jbyteArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ExpandedKey_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ExpandedKey_new + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1new + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: create + * Signature: (JJIJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create + (JNIEnv *, jclass, jlong, jlong, jint, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: create_from_hash + * Signature: (JJ[BIJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1from_1hash + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jint, jlong); + /* * Class: org_ldk_impl_bindings * Method: DecodeError_free @@ -16689,82 +17121,82 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_free + * Method: ChannelReady_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_get_channel_id + * Method: ChannelReady_get_channel_id * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_set_channel_id + * Method: ChannelReady_set_channel_id * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1channel_1id (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_get_next_per_commitment_point + * Method: ChannelReady_get_next_per_commitment_point * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1next_1per_1commitment_1point (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_set_next_per_commitment_point + * Method: ChannelReady_set_next_per_commitment_point * Signature: (J[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1next_1per_1commitment_1point (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_get_short_channel_id_alias + * Method: ChannelReady_get_short_channel_id_alias * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1short_1channel_1id_1alias +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1short_1channel_1id_1alias (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_set_short_channel_id_alias + * Method: ChannelReady_set_short_channel_id_alias * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1short_1channel_1id_1alias +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1short_1channel_1id_1alias (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_new + * Method: ChannelReady_new * Signature: ([B[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReady_1new (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_clone_ptr + * Method: ChannelReady_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_clone + * Method: ChannelReady_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone (JNIEnv *, jclass, jlong); /* @@ -18383,6 +18815,14 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fe JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths (JNIEnv *, jclass, jlong, jint); +/* + * Class: org_ldk_impl_bindings + * Method: UnsignedChannelUpdate_set_excess_data + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1excess_1data + (JNIEnv *, jclass, jlong, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: UnsignedChannelUpdate_clone_ptr @@ -19257,18 +19697,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_write + * Method: ChannelReady_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FundingLocked_read + * Method: ChannelReady_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReady_1read (JNIEnv *, jclass, jbyteArray); /* @@ -20801,843 +21241,1859 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionPara /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelTransactionParameters_broadcaster_pubkeys - * Signature: (J)J + * Method: DirectedChannelTransactionParameters_broadcaster_pubkeys + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DirectedChannelTransactionParameters_countersignatory_pubkeys + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DirectedChannelTransactionParameters_contest_delay + * Signature: (J)S + */ +JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DirectedChannelTransactionParameters_is_outbound + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DirectedChannelTransactionParameters_funding_outpoint + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DirectedChannelTransactionParameters_opt_anchors + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_get_counterparty_sig + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_set_counterparty_sig + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_set_counterparty_htlc_sigs + * Signature: (J[[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs + (JNIEnv *, jclass, jlong, jobjectArray); + +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: HolderCommitmentTransaction_new + * Signature: (J[B[[B[B[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new + (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_get_transaction + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_set_transaction + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_get_txid + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_set_txid + * Signature: (J[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid + (JNIEnv *, jclass, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_new + * Signature: ([B[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_get_sighash_all + * Signature: (J[BJ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1sighash_1all + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BuiltCommitmentTransaction_sign + * Signature: (J[B[BJ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_new + * Signature: (JJ[B[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_trust + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_verify + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_to_holder_value_sat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_to_counterparty_value_sat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_to_holder_script + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ClosingTransaction_to_counterparty_script + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedClosingTransaction_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedClosingTransaction_built_transaction + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedClosingTransaction_get_sighash_all + * Signature: (J[BJ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1get_1sighash_1all + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedClosingTransaction_sign + * Signature: (J[B[BJ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1sign + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_commitment_number + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_to_broadcaster_value_sat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_to_countersignatory_value_sat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_feerate_per_kw + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_trust + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CommitmentTransaction_verify + * Signature: (JJJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1verify + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedCommitmentTransaction_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedCommitmentTransaction_txid + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedCommitmentTransaction_built_transaction + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedCommitmentTransaction_keys + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedCommitmentTransaction_opt_anchors + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: TrustedCommitmentTransaction_get_htlc_sigs + * Signature: (J[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs + (JNIEnv *, jclass, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: get_commitment_transaction_number_obscure_factor + * Signature: ([B[BZ)J + */ +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_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelFeatures_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceFeatures_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelFeatures_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceFeatures_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelFeatures_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceFeatures_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_known + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_unknown_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_known + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_unknown_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelFeatures_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelFeatures_known + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelFeatures_requires_unknown_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceFeatures_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceFeatures_known + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceFeatures_requires_unknown_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_known + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTypeFeatures_requires_unknown_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: 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: InvoiceFeatures_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceFeatures_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_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: InitFeatures_set_data_loss_protect_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_data_loss_protect_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_data_loss_protect + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_data_loss_protect_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_data_loss_protect_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_data_loss_protect + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_data_loss_protect + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_data_loss_protect + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_initial_routing_sync_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_initial_routing_sync_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_initial_routing_sync + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_upfront_shutdown_script_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_upfront_shutdown_script_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_upfront_shutdown_script + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_upfront_shutdown_script_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_upfront_shutdown_script_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_supports_upfront_shutdown_script + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_requires_upfront_shutdown_script + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_requires_upfront_shutdown_script + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_gossip_queries_optional + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_set_gossip_queries_required + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InitFeatures_supports_gossip_queries + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NodeFeatures_set_gossip_queries_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelTransactionParameters_countersignatory_pubkeys - * Signature: (J)J + * Method: NodeFeatures_set_gossip_queries_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelTransactionParameters_contest_delay - * Signature: (J)S + * Method: NodeFeatures_supports_gossip_queries + * Signature: (J)Z */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelTransactionParameters_is_outbound + * Method: InitFeatures_requires_gossip_queries * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelTransactionParameters_funding_outpoint - * Signature: (J)J + * Method: NodeFeatures_requires_gossip_queries + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelTransactionParameters_opt_anchors - * Signature: (J)Z + * Method: InitFeatures_set_variable_length_onion_optional + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_free + * Method: InitFeatures_set_variable_length_onion_required * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_get_counterparty_sig - * Signature: (J)[B + * Method: InitFeatures_supports_variable_length_onion + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_set_counterparty_sig - * Signature: (J[B)V + * Method: NodeFeatures_set_variable_length_onion_optional + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_set_counterparty_htlc_sigs - * Signature: (J[[B)V + * Method: NodeFeatures_set_variable_length_onion_required + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs - (JNIEnv *, jclass, jlong, jobjectArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_clone_ptr - * Signature: (J)J + * Method: NodeFeatures_supports_variable_length_onion + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_clone - * Signature: (J)J + * Method: InvoiceFeatures_set_variable_length_onion_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_write - * Signature: (J)[B + * Method: InvoiceFeatures_set_variable_length_onion_required + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_read - * Signature: ([B)J + * Method: InvoiceFeatures_supports_variable_length_onion + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1variable_1length_1onion + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: HolderCommitmentTransaction_new - * Signature: (J[B[[B[B[B)J + * Method: InitFeatures_requires_variable_length_onion + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new - (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray, jbyteArray, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_free - * Signature: (J)V + * Method: NodeFeatures_requires_variable_length_onion + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_get_transaction - * Signature: (J)[B + * Method: InvoiceFeatures_requires_variable_length_onion + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1variable_1length_1onion (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_set_transaction - * Signature: (J[B)V + * Method: InitFeatures_set_static_remote_key_optional + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_get_txid - * Signature: (J)[B + * Method: InitFeatures_set_static_remote_key_required + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_set_txid - * Signature: (J[B)V + * Method: InitFeatures_supports_static_remote_key + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_new - * Signature: ([B[B)J + * Method: NodeFeatures_set_static_remote_key_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new - (JNIEnv *, jclass, jbyteArray, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_clone_ptr - * Signature: (J)J + * Method: NodeFeatures_set_static_remote_key_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_clone - * Signature: (J)J + * Method: NodeFeatures_supports_static_remote_key + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_write - * Signature: (J)[B + * Method: ChannelTypeFeatures_set_static_remote_key_optional + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_read - * Signature: ([B)J + * Method: ChannelTypeFeatures_set_static_remote_key_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_get_sighash_all - * Signature: (J[BJ)[B + * Method: ChannelTypeFeatures_supports_static_remote_key + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1sighash_1all - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BuiltCommitmentTransaction_sign - * Signature: (J[B[BJ)[B + * Method: InitFeatures_requires_static_remote_key + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_free - * Signature: (J)V + * Method: NodeFeatures_requires_static_remote_key + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_clone_ptr - * Signature: (J)J + * Method: ChannelTypeFeatures_requires_static_remote_key + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_clone - * Signature: (J)J + * Method: InitFeatures_set_payment_secret_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_hash - * Signature: (J)J + * Method: InitFeatures_set_payment_secret_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_new - * Signature: (JJ[B[BJ)J + * Method: InitFeatures_supports_payment_secret + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new - (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_trust - * Signature: (J)J + * Method: NodeFeatures_set_payment_secret_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_verify - * Signature: (JJ)J + * Method: NodeFeatures_set_payment_secret_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_to_holder_value_sat - * Signature: (J)J + * Method: NodeFeatures_supports_payment_secret + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_to_counterparty_value_sat - * Signature: (J)J + * Method: InvoiceFeatures_set_payment_secret_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_to_holder_script - * Signature: (J)[B + * Method: InvoiceFeatures_set_payment_secret_required + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ClosingTransaction_to_counterparty_script - * Signature: (J)[B + * Method: InvoiceFeatures_supports_payment_secret + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedClosingTransaction_free - * Signature: (J)V + * Method: InitFeatures_requires_payment_secret + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedClosingTransaction_built_transaction - * Signature: (J)[B + * Method: NodeFeatures_requires_payment_secret + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedClosingTransaction_get_sighash_all - * Signature: (J[BJ)[B + * Method: InvoiceFeatures_requires_payment_secret + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1get_1sighash_1all - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1payment_1secret + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedClosingTransaction_sign - * Signature: (J[B[BJ)[B + * Method: InitFeatures_set_basic_mpp_optional + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1sign - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_free + * Method: InitFeatures_set_basic_mpp_required * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_clone_ptr - * Signature: (J)J + * Method: InitFeatures_supports_basic_mpp + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_clone - * Signature: (J)J + * Method: NodeFeatures_set_basic_mpp_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_write - * Signature: (J)[B + * Method: NodeFeatures_set_basic_mpp_required + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_read - * Signature: ([B)J + * Method: NodeFeatures_supports_basic_mpp + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_commitment_number - * Signature: (J)J + * Method: InvoiceFeatures_set_basic_mpp_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_to_broadcaster_value_sat - * Signature: (J)J + * Method: InvoiceFeatures_set_basic_mpp_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_to_countersignatory_value_sat - * Signature: (J)J + * Method: InvoiceFeatures_supports_basic_mpp + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1basic_1mpp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_feerate_per_kw - * Signature: (J)I + * Method: InitFeatures_requires_basic_mpp + * Signature: (J)Z */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_trust - * Signature: (J)J + * Method: NodeFeatures_requires_basic_mpp + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CommitmentTransaction_verify - * Signature: (JJJJ)J + * Method: InvoiceFeatures_requires_basic_mpp + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1verify - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1basic_1mpp + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedCommitmentTransaction_free + * Method: InitFeatures_set_wumbo_optional * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedCommitmentTransaction_txid - * Signature: (J)[B + * Method: InitFeatures_set_wumbo_required + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedCommitmentTransaction_built_transaction - * Signature: (J)J + * Method: InitFeatures_supports_wumbo + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedCommitmentTransaction_keys - * Signature: (J)J + * Method: NodeFeatures_set_wumbo_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedCommitmentTransaction_opt_anchors - * Signature: (J)Z + * Method: NodeFeatures_set_wumbo_required + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: TrustedCommitmentTransaction_get_htlc_sigs - * Signature: (J[BJ)J + * Method: NodeFeatures_supports_wumbo + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: get_commitment_transaction_number_obscure_factor - * Signature: ([B[BZ)J + * Method: InitFeatures_requires_wumbo + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1commitment_1transaction_1number_1obscure_1factor - (JNIEnv *, jclass, jbyteArray, jbyteArray, jboolean); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_eq - * Signature: (JJ)Z + * Method: NodeFeatures_requires_wumbo + * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_eq - * Signature: (JJ)Z + * Method: InitFeatures_set_shutdown_any_segwit_optional + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_eq - * Signature: (JJ)Z + * Method: InitFeatures_set_shutdown_any_segwit_required + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceFeatures_eq - * Signature: (JJ)Z + * Method: InitFeatures_supports_shutdown_anysegwit + * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_eq - * Signature: (JJ)Z + * Method: NodeFeatures_set_shutdown_any_segwit_optional + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_clone_ptr - * Signature: (J)J + * Method: NodeFeatures_set_shutdown_any_segwit_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_clone - * Signature: (J)J + * Method: NodeFeatures_supports_shutdown_anysegwit + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_clone_ptr - * Signature: (J)J + * Method: InitFeatures_requires_shutdown_anysegwit + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_clone - * Signature: (J)J + * Method: NodeFeatures_requires_shutdown_anysegwit + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_clone_ptr - * Signature: (J)J + * Method: InitFeatures_set_channel_type_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_clone - * Signature: (J)J + * Method: InitFeatures_set_channel_type_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceFeatures_clone_ptr - * Signature: (J)J + * Method: InitFeatures_supports_channel_type + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceFeatures_clone - * Signature: (J)J + * Method: NodeFeatures_set_channel_type_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_clone_ptr - * Signature: (J)J + * Method: NodeFeatures_set_channel_type_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_clone - * Signature: (J)J + * Method: NodeFeatures_supports_channel_type + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_free - * Signature: (J)V + * Method: InitFeatures_requires_channel_type + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_free - * Signature: (J)V + * Method: NodeFeatures_requires_channel_type + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_free + * Method: InitFeatures_set_scid_privacy_optional * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceFeatures_free + * Method: InitFeatures_set_scid_privacy_required * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_free - * Signature: (J)V + * Method: InitFeatures_supports_scid_privacy + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_empty - * Signature: ()J + * Method: NodeFeatures_set_scid_privacy_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_known - * Signature: ()J + * Method: NodeFeatures_set_scid_privacy_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_requires_unknown_bits + * Method: NodeFeatures_supports_scid_privacy * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_empty - * Signature: ()J + * Method: ChannelTypeFeatures_set_scid_privacy_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_known - * Signature: ()J + * Method: ChannelTypeFeatures_set_scid_privacy_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_requires_unknown_bits + * Method: ChannelTypeFeatures_supports_scid_privacy * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_empty - * Signature: ()J + * Method: InitFeatures_requires_scid_privacy + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_known - * Signature: ()J + * Method: NodeFeatures_requires_scid_privacy + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known - (JNIEnv *, jclass); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_requires_unknown_bits + * Method: ChannelTypeFeatures_requires_scid_privacy * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceFeatures_empty - * Signature: ()J + * Method: InitFeatures_set_zero_conf_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceFeatures_known - * Signature: ()J + * Method: InitFeatures_set_zero_conf_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceFeatures_requires_unknown_bits + * Method: InitFeatures_supports_zero_conf * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_empty - * Signature: ()J + * Method: NodeFeatures_set_zero_conf_optional + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_known - * Signature: ()J + * Method: NodeFeatures_set_zero_conf_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_requires_unknown_bits + * Method: NodeFeatures_supports_zero_conf * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_write - * Signature: (J)[B + * Method: ChannelTypeFeatures_set_zero_conf_optional + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InitFeatures_read - * Signature: ([B)J + * Method: ChannelTypeFeatures_set_zero_conf_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_write - * Signature: (J)[B + * Method: ChannelTypeFeatures_supports_zero_conf + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelFeatures_read - * Signature: ([B)J + * Method: InitFeatures_requires_zero_conf + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_write - * Signature: (J)[B + * Method: NodeFeatures_requires_zero_conf + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NodeFeatures_read - * Signature: ([B)J + * Method: ChannelTypeFeatures_requires_zero_conf + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceFeatures_write - * Signature: (J)[B + * Method: NodeFeatures_set_keysend_optional + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: InvoiceFeatures_read - * Signature: ([B)J + * Method: NodeFeatures_set_keysend_required + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_write - * Signature: (J)[B + * Method: NodeFeatures_supports_keysend + * Signature: (J)Z */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ChannelTypeFeatures_read - * Signature: ([B)J + * Method: NodeFeatures_requires_keysend + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -21879,22 +23335,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeId_1read JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: NetworkGraph_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: NetworkGraph_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: ReadOnlyNetworkGraph_free @@ -21937,10 +23377,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1updat /* * Class: org_ldk_impl_bindings - * Method: NetworkUpdate_channel_closed + * Method: NetworkUpdate_channel_failure * Signature: (JZ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1closed +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure (JNIEnv *, jclass, jlong, jboolean); /* @@ -21969,50 +23409,50 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read /* * Class: org_ldk_impl_bindings - * Method: NetGraphMsgHandler_as_EventHandler - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1EventHandler - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: NetGraphMsgHandler_free + * Method: P2PGossipSync_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetGraphMsgHandler_new + * Method: P2PGossipSync_new * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1new (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetGraphMsgHandler_add_chain_access + * Method: P2PGossipSync_add_chain_access * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain_1access +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1chain_1access (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetGraphMsgHandler_as_RoutingMessageHandler + * Method: NetworkGraph_as_EventHandler + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1as_1EventHandler + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: P2PGossipSync_as_RoutingMessageHandler * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: NetGraphMsgHandler_as_MessageSendEventsProvider + * Method: P2PGossipSync_as_MessageSendEventsProvider * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1MessageSendEventsProvider +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider (JNIEnv *, jclass, jlong); /* @@ -22311,6 +23751,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelInfo_get_directional_info + * Signature: (JB)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info + (JNIEnv *, jclass, jlong, jbyte); + /* * Class: org_ldk_impl_bindings * Method: ChannelInfo_write @@ -22367,6 +23815,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1direction (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: DirectedChannelInfo_htlc_maximum_msat + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1htlc_1maximum_1msat + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: DirectedChannelInfo_effective_capacity @@ -22778,18 +24234,18 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write /* * Class: org_ldk_impl_bindings * Method: NetworkGraph_read - * Signature: ([B)J + * Signature: ([BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read - (JNIEnv *, jclass, jbyteArray); + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings * Method: NetworkGraph_new - * Signature: ([B)J + * Signature: ([BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new - (JNIEnv *, jclass, jbyteArray); + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings @@ -22799,6 +24255,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_get_last_rapid_gossip_sync_timestamp + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_set_last_rapid_gossip_sync_timestamp + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1set_1last_1rapid_1gossip_1sync_1timestamp + (JNIEnv *, jclass, jlong, jint); + /* * Class: org_ldk_impl_bindings * Method: NetworkGraph_update_node_from_announcement @@ -22833,18 +24305,26 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_close_channel_from_update + * Method: NetworkGraph_add_channel_from_partial_announcement + * Signature: (JJJJ[B[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1add_1channel_1from_1partial_1announcement + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: NetworkGraph_channel_failed * Signature: (JJZ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1from_1update +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed (JNIEnv *, jclass, jlong, jlong, jboolean); /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_fail_node + * Method: NetworkGraph_node_failed * Signature: (J[BZ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed (JNIEnv *, jclass, jlong, jbyteArray, jboolean); /* @@ -23663,6 +25143,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_find_1route (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlongArray, jlong, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: build_route_from_hops + * Signature: ([B[[BJJJ[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1route_1from_1hops + (JNIEnv *, jclass, jbyteArray, jobjectArray, jlong, jlong, jlong, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: Score_free @@ -23689,251 +25177,155 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1fr /* * Class: org_ldk_impl_bindings - * Method: MultiThreadedLockableScore_new - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_with_penalty - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_as_Score - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_write + * Method: MultiThreadedLockableScore_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FixedPenaltyScorer_read - * Signature: ([BJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read - (JNIEnv *, jclass, jbyteArray, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Scorer_free - * Signature: (J)V + * Method: MultiThreadedLockableScore_new + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_free + * Method: ChannelUsage_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: ScoringParameters_get_base_penalty_msat - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1base_1penalty_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_set_base_penalty_msat - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1penalty_1msat - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: ScoringParameters_get_failure_penalty_msat + * Method: ChannelUsage_get_amount_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1msat +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_set_failure_penalty_msat + * Method: ChannelUsage_set_amount_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1msat +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_get_overuse_penalty_start_1024th - * Signature: (J)S - */ -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1start_11024th - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: ScoringParameters_set_overuse_penalty_start_1024th - * Signature: (JS)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1start_11024th - (JNIEnv *, jclass, jlong, jshort); - -/* - * Class: org_ldk_impl_bindings - * Method: ScoringParameters_get_overuse_penalty_msat_per_1024th + * Method: ChannelUsage_get_inflight_htlc_msat * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1msat_1per_11024th +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_set_overuse_penalty_msat_per_1024th + * Method: ChannelUsage_set_inflight_htlc_msat * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1msat_1per_11024th +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_get_failure_penalty_half_life + * Method: ChannelUsage_get_effective_capacity * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1half_1life +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_set_failure_penalty_half_life + * Method: ChannelUsage_set_effective_capacity * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1half_1life +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_new - * Signature: (JJSJJ)J + * Method: ChannelUsage_new + * Signature: (JJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new - (JNIEnv *, jclass, jlong, jlong, jshort, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1new + (JNIEnv *, jclass, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_clone_ptr + * Method: ChannelUsage_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_clone + * Method: ChannelUsage_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_write - * Signature: (J)[B + * Method: FixedPenaltyScorer_free + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1write +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1read - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: Scorer_new + * Method: FixedPenaltyScorer_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Scorer_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Scorer_default - * Signature: ()J + * Method: FixedPenaltyScorer_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Scorer_1default - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: ScoringParameters_default - * Signature: ()J + * Method: FixedPenaltyScorer_with_penalty + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Scorer_as_Score + * Method: FixedPenaltyScorer_as_Score * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Scorer_1as_1Score +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Scorer_write + * Method: FixedPenaltyScorer_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Scorer_read - * Signature: ([B)J + * Method: FixedPenaltyScorer_read + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Scorer_1read - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read + (JNIEnv *, jclass, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings @@ -24042,10 +25434,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameter /* * Class: org_ldk_impl_bindings * Method: ProbabilisticScorer_new - * Signature: (JJ)J + * Signature: (JJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1new - (JNIEnv *, jclass, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ProbabilisticScorer_debug_log_liquidity_stats + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -24074,10 +25474,10 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1wri /* * Class: org_ldk_impl_bindings * Method: ProbabilisticScorer_read - * Signature: ([BJJ)J + * Signature: ([BJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read - (JNIEnv *, jclass, jbyteArray, jlong, jlong); + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -24105,59 +25505,59 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1d /* * Class: org_ldk_impl_bindings - * Method: FilesystemPersister_persist_manager - * Signature: (Ljava/lang/String;J)J + * Method: FilesystemPersister_read_channelmonitors + * Signature: (JJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persist_1manager - (JNIEnv *, jclass, jstring, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1channelmonitors + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: FilesystemPersister_persist_network_graph - * Signature: (Ljava/lang/String;J)J + * Method: BackgroundProcessor_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persist_1network_1graph - (JNIEnv *, jclass, jstring, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FilesystemPersister_read_channelmonitors - * Signature: (JJ)J + * Method: GossipSync_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1channelmonitors - (JNIEnv *, jclass, jlong, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipSync_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: FilesystemPersister_as_Persist + * Method: GossipSync_p2_p * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1as_1Persist +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipSync_1p2_1p (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BackgroundProcessor_free - * Signature: (J)V + * Method: GossipSync_rapid + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipSync_1rapid (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: Persister_free - * Signature: (J)V + * Method: GossipSync_none + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipSync_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings * Method: BackgroundProcessor_start - * Signature: (JJJJJJJ)J + * Signature: (JJJJJJJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start - (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -25729,66 +27129,58 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free /* * Class: org_ldk_impl_bindings - * Method: RetryAttempts_free + * Method: Retry_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RetryAttempts_get_a + * Method: Retry_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RetryAttempts_set_a - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: RetryAttempts_new + * Method: Retry_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RetryAttempts_clone_ptr + * Method: Retry_attempts * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1attempts (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RetryAttempts_clone + * Method: Retry_timeout * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1timeout (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: RetryAttempts_eq + * Method: Retry_eq * Signature: (JJ)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1eq +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings - * Method: RetryAttempts_hash + * Method: Retry_hash * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Retry_1hash (JNIEnv *, jclass, jlong); /* @@ -25890,50 +27282,50 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHandle /* * Class: org_ldk_impl_bindings * Method: create_phantom_invoice - * Signature: (JLjava/lang/String;[B[B[JJLorg/ldk/enums/Currency;)J + * Signature: (J[BLjava/lang/String;I[JJLorg/ldk/enums/Currency;)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice - (JNIEnv *, jclass, jlong, jstring, jbyteArray, jbyteArray, jlongArray, jlong, jobject); + (JNIEnv *, jclass, jlong, jbyteArray, jstring, jint, jlongArray, jlong, jobject); /* * Class: org_ldk_impl_bindings * Method: create_phantom_invoice_with_description_hash - * Signature: (JJ[B[B[JJLorg/ldk/enums/Currency;)J + * Signature: (J[BIJ[JJLorg/ldk/enums/Currency;)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash - (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray, jlongArray, jlong, jobject); + (JNIEnv *, jclass, jlong, jbyteArray, jint, jlong, jlongArray, jlong, jobject); /* * Class: org_ldk_impl_bindings * Method: create_invoice_from_channelmanager - * Signature: (JJLorg/ldk/enums/Currency;JLjava/lang/String;)J + * Signature: (JJLorg/ldk/enums/Currency;JLjava/lang/String;I)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager - (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jstring); + (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jstring, jint); /* * Class: org_ldk_impl_bindings * Method: create_invoice_from_channelmanager_with_description_hash - * Signature: (JJLorg/ldk/enums/Currency;JJ)J + * Signature: (JJLorg/ldk/enums/Currency;JJI)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash - (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jlong, jint); /* * Class: org_ldk_impl_bindings * Method: create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch - * Signature: (JJLorg/ldk/enums/Currency;JJJ)J + * Signature: (JJLorg/ldk/enums/Currency;JJJI)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch - (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jlong, jlong, jint); /* * Class: org_ldk_impl_bindings * Method: create_invoice_from_channelmanager_and_duration_since_epoch - * Signature: (JJLorg/ldk/enums/Currency;JLjava/lang/String;J)J + * Signature: (JJLorg/ldk/enums/Currency;JLjava/lang/String;JI)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch - (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jstring, jlong); + (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jstring, jlong, jint); /* * Class: org_ldk_impl_bindings @@ -26039,6 +27431,86 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Currency_1to_1str JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: RapidGossipSync_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RapidGossipSync_new + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1new + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RapidGossipSync_sync_network_graph_with_file_path + * Signature: (JLjava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1sync_1network_1graph_1with_1file_1path + (JNIEnv *, jclass, jlong, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: RapidGossipSync_is_initial_sync_complete + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1is_1initial_1sync_1complete + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: GraphSyncError_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: GraphSyncError_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: GraphSyncError_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: GraphSyncError_decode_error + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1decode_1error + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: GraphSyncError_lightning_error + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1lightning_1error + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: RapidGossipSync_update_network_graph + * Signature: (J[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph + (JNIEnv *, jclass, jlong, jbyteArray); + #ifdef __cplusplus } #endif -- 2.30.2